the positive look ahead expression (?= ) seems to be
working only in the end of the expression. For ex. if
an expression for some words inside tags is needed we
expect this to do the work:
(?= <(\[^>\]\*))thewordIsearch(?=(\[^<\]\*)>)
it doesn't work, but of course if I remove look
ahead: "(<(\[^>\]\*))thewordIsearch(?=(\[^<\]\*)>)" it
works, but it doesnt hide the text before the word I
search for.
Submitted | velniava - 2005-12-05 15:18:12 | Assigned | |
---|---|---|---|
Priority | 5 | Labels | search and replace |
Status | open | Group | minor bug |
Resolution | None |
2007-02-14 21:25:57 rschwenn |
Logged In: YES |
---|---|
2010-03-27 18:37:04 kerik-sf |
I'm by no mean a regexp expert (far from it), but shouldn't one use a positive look-behind
?
|
2010-03-27 18:37:05 kerik-sf |
- **status**: open --> pending-invalid |
2010-03-27 18:51:34 kerik-sf |
- **status**: pending-invalid --> open |
2010-03-27 18:51:34 kerik-sf |
my suggestion doesn't work on inputs like this : "<lebonjour>" while it should \!
|
2010-03-27 18:57:30 kerik-sf |
the workaround suggested in the sun bug report works : "bonjour(?<=<(\[^>\]{0,100}bonjour))(?=(\[^<\]\*)>)".
|
2010-03-27 18:57:36 kerik-sf |
beanshell to run on itself test_positive_lookahead.bsh (686B) |