Re: How to exclude a sequence of characters

2011-03-25 Thread Daniel F. Savarese
In message , "Thomas Wiedmann" writes: >May be, but what's the solution, i. e. how must the RegExp statement be >written, that texts like "mytext-end" are not matched? I already answered your question. You confirmed firsthand that jakarta regexp does not support negative lookahead assertions (a

Re: How to exclude a sequence of characters

2011-03-25 Thread Thomas Wiedmann
"Jon Gorrono" schrieb im Newsbeitrag news:AANLkTik9Khsh_MqmFaBD2DB7v9L8pz=qirr8eh93n...@mail.gmail.com... '-xyz' literal does not match the '-end' literal... if you want to match any three-character ending you'll need something like '-...' in the regexp Also, I can't recall of the dash needs to

Re: How to exclude a sequence of characters

2011-03-22 Thread Jon Gorrono
'-xyz' literal does not match the '-end' literal... if you want to match any three-character ending you'll need something like '-...' in the regexp Also, I can't recall of the dash needs to be escaped outside a square-bracket operator pair, but it might be interpreted as a range operator here. O

Re: How to exclude a sequence of characters

2011-03-22 Thread Thomas Wiedmann
It sounds like you want to use a zero-width negative lookahead assertion. For example: test(?!-end) You should probably use java.util.regex. I tried the Java statements String text = "mytest-xyz"; String pattern = ".*test(?!-end)"; System.out.println(text.matches(pattern) ? "Ok" : "NOk

Re: How to exclude a sequence of characters

2011-03-12 Thread Daniel F. Savarese
In message , "Thomas Wiedmann" writes: >Example: Trying to get all matches of the pattern 'test' but excluding all >matches of the pattern '-end', i. e. if the text contains 'test-end' this >text location should not be matched. > >By which regular expression can this search condition be realized