On Thu, 16 Jul 2009, Karsten Br?ckelmann wrote:
Whoops! Make that:
/(?:[^_]{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.
Exactly _five_ occurrences of an '_' underscore, with up to 30 _random_
chars in between. This paragraph matches. :)
Sorry. I lost sight of that part...
/(?:[^_\s]{1,30}_+){5}/
--
John Hardin KA7OHZ http://www.impsec.org/~jhardin/
jhar...@impsec.org FALaholic #11174 pgpk -a jhar...@impsec.org
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
You know things are bad when Pravda says we [the USA] have gone
too far to the left. -- Joe Huffman
-----------------------------------------------------------------------
Today: the 64th anniversary of the dawn of the Atomic Age