PreviousNextTracker indexSee it online !

(86/212) 246 - Support look-behind regexes with variable but bounded width

According to http://www.regular-expressions.info/lookaround.html, PCRE and Java support regular expressions with variable-length look-behinds, as long as the length has a definite upper bound. It would be nice to have this kind of feature.

PS: I ran into this issue when trying to find all variables with a specific prefix that appear exactly once in a file. I'm not a regex expert, so I'm not sure if it should work, but here's my regex (split for readability:
\A
(?<\!\1) # Not preceded by first match
(\b(l|p|g|C)_\w{1,28}\b) # Matches e.g. "l_foo"
(?\!\1) # Not followed by first match
\Z

Submitted engmark - 2008-10-08 07:33:47 Assigned
Priority 5 Labels
Status open Group None
Resolution None

Comments