java - Regular expression Notepad++ OK JDK 1.6 NOK -


as part of internship, have use regular expressions parse log file. it's java log , have problem detection of exceptions.

in fact, regular expression works on notepad++ not java (1.6), matcher.find() take very, ..., long time, , find 0 match finally.

this regular expression:

(.*\berror\b.*)\r?\n((\tat|.*[ee]xception|\t\.\.\.|\r?\n|ora-).*\r?\n)+(^(?!.*error).+)\r?\n 

do know why ?

thanks.

back slash \ both escape character java programming language , regular expressions. therefore when slashes regular expressions inside java (and many other programming languages) have duplicate slash.

for example write \\s instead of \s requires syntax of regular expression.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -