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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -