PreviousNextTracker indexSee it online !

(96/207) 2152750 - Support look-behind regexes with variable but bounded width

According to, 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:
(?<!\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

Submitted engmark - 2008-10-08 - 07:33:47z Assigned nobody
Priority 5 Category None
Status Open Group None
Resolution None Visibility No