Page 3 of 3

Posted: 10.04.2015 13:09
by senendds
I have a problem with this regexp:

Code: Select all

^\s*\*.*
I'm trying to tag as a comment any line in which the first non whitespace is an asterisk. But as can be seen in the image, even when the comments in line 3 and 5 are matched (they appear in green), the comment in line 7 is not.

And the only difference between the comment in 5 and in 7 are the spaces in line 6...

Is the regex wrong?

Posted: 10.04.2015 15:19
by Alexey
yes: don't do \s, instead do [\x20\x09]*

Posted: 10.04.2015 19:25
by senendds
I'm afraid it doesn't work either.

^[\x20\x09]*\*.*
does not match the comment in line 7 nor the comment in 5...

I get that \s matches newline but even so, I don't see why my regexp shouldn't work.

Posted: 10.04.2015 19:27
by Alexey
\Skip spaces on parsing\--turn it off, so spaces found by regex, lexer dialog

Posted: 10.04.2015 20:16
by senendds
Thanks!. That was the problem.