From: SourceForge.net <no...@so...> - 2010-03-27 18:51:34
|
Bugs item #1373607, was opened at 2005-12-05 16:18 Message generated for change (Comment added) made by kerik-sf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1373607&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: search and replace Group: minor bug >Status: Open >Resolution: None Priority: 5 Private: No Submitted By: velniava (velniava) Assigned to: Nobody/Anonymous (nobody) Summary: positive lookahead does only work in the end Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Eric Le Lay (kerik-sf) Date: 2010-03-27 19:51 Message: my suggestion doesn't work on inputs like this : "<lebonjour>" while it should ! It's a bug in the regex engine, see : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6284152 ---------------------------------------------------------------------- Comment By: Eric Le Lay (kerik-sf) Date: 2010-03-27 19:37 Message: I'm by no mean a regexp expert (far from it), but shouldn't one use a positive look-behind ? At first, I tried (?<=<([^>]*))bonjour(?=([^<]*)>) but got a java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 11 (?<=<([^>]*))bonjour(?=([^<]*)>) So I added an explicit bound and found that (?<=<([^>]{0,100}?))bonjour(?=([^<]*)>) works ---------------------------------------------------------------------- Comment By: Robert Schwenn (rschwenn) Date: 2007-02-14 22:25 Message: Logged In: YES user_id=1486645 Originator: NO Sill valid for jEdit 4.3pre9. SUN JRE 1.5.0_11 WinXP SP2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1373607&group_id=588 |