Curious but are the non capturing groups necessary?
On 17 Jan 2016 11:35 p.m., "Tom Browder" <tom.brow...@gmail.com> wrote:

> On Sun, Jan 17, 2016 at 3:03 PM, Moritz Lenz <mor...@faui2k3.org> wrote:
> > On 01/17/2016 06:07 PM, Tom Browder wrote:
> ...
> >> # regex of dirs to ignore
> >> my regex dirs {
> >>   \/home\/user\/\.cpan |
> >>   \/home\/tbrowde\/\.emacs
> >> }
> >
> > Better written as
> >
> > my regex dirs {
> >    | '/home/user/.cpan'
> >    | '/home/tbowde/.emacs'
> > }
> >
> > Yes, quoting does now work in regexes too. Cool, right? :-)
>
> Yes, very cool!  I have decided to use that format and it does ease
> adding or modifying entries.
>
> My final regex looks like this (shortened to only a couple of entries):
>
> my regex dirs {
>   ^
>   \s*
>   [        # <= non-capture grouping
>            | '/home/user/.cpan'
>            | '/home/tbowde/.emacs'
>            # more entries...
>   ]
> }
>
> used like this:
>
>   next LINE if $line ~~ /<dirs>/;
>
> Thanks, Moritz!
>
> Best,
>
> -Tom
>

Reply via email to