On Thu, 16 Jul 2009, Karsten Bräckelmann wrote:
/(?:[^_]{1,30}_+){5}/
Better. ;) However, while that indeed eliminates excessive backtracking
as \S or \w results in (since they contain the underscore), this doesn't
match "words ending in underscores". A non-underscore [^_] includes
space, punctuation, and any other unwanted char.
Given that OP said the entire *line* was word-underscore-word-underscore,
then why not just:
body R01 /^\w{30,}$/m
Or perhaps the OP wasn't clear on whether 'word' might contain other
punctuation, and so we might simply use:
body R02 /^\S{30,}$/m
I might add \s* at the end of the rule, just in case of trailing spaces...
- C