Regular expression question

line !~ /(^#)|(^[\s\t]*$)/

Is supposed to filter empty lines and lines commented by “#” symbol at
the beginning.
Separately the both patterns work but with “|” operation it doesn’t
filter. What I missed?

Roman Rytov

I don’t master regex … but it seems you haven’t to put a backslash
before |

···

On Tue, 2002-12-03 at 17:15, Roman Rytov wrote:

line !~ /\(^#\)\|\(^[\s\t]*$\)/

Is supposed to filter empty lines and lines commented by “#” symbol at
the beginning.
Separately the both patterns work but with “|” operation it doesn’t
filter. What I missed?

Roman Rytov


Ludo coquelle@enib.fr
ENIB/LI2