Il giorno 17/dic/05, alle ore 22:22, Oliver Taylor ha scritto:
I would assume that the following would assign a scope to an empty line, but it's not working. Any ideas? Is this possible?
{ name = 'splay.empty'; match = '^$'; },
IIRC you have to match the \n as well in order to match the whole line
Yeah, I've tried every iteration, \n^$, ^\n$, ^$\n ... as you might be able to tell I'm really bad with regexp.
any help is appreciated.
1. ^\n matches an empty line (and by empty I mean EMPTY ;) 2. ^\s*?\n matches lines that are empty or contain only whitespace 3. ^\s*\n matches *groups of 1 or more consecutive lines* that are empty or contain only whitespace
I think (and experiments show that) $ before \n is superfluous. (the difference btw. 2 and 3 is in the non-greedy "?" modifier, but I'm not good enough at regexes to explain you the Arcane Secrets :)
ciao,
Domenico