Message from discussion
Regex query
Newsgroups: perl.perl6.language
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <si...@ermine.ox.ac.uk>
Mailing-List: contact perl6-language-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-langu...@perl.org
To: perl6-langu...@perl.org
Sender: si...@squash.valueclick.com
Subject: Re: Regex query
References: <86lm5xry63.fsf@squash.oucs.ox.ac.uk> <x7k7lhupny.fsf@mail.sysarch.com>
Date: 20 Sep 2002 08:06:39 +0100
Message-ID: <86heglrvgg.fsf@squash.oucs.ox.ac.uk>
Organization: Bethnal Green is PEOPLE!
Lines: 44
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Posted-By: 163.1.14.185
Approved: n...@nntp.perl.org
From: si...@ermine.ox.ac.uk (Simon Cozens)
u...@stemsystems.com (Uri Guttman) writes:
> shouldn't that have a <sp*> inside the blank line?
Or <sp>*, yes.
> SC> rule comm_eol { <sp*> <comment>? <sp*> \n };
>
> aren't those <sp*>'s redundant? the first is overlapping with the one at
> the beginning of comment.
But <comment> only matches if there *is* a comment, and there may not
be, so I want to match optional space at the EOL anyway.
> SC> rule raiddev { <comment>*
> i think that should be comm_eol as you want to skip all full comment lines.
I thought the .* (or \N*) would skip the whole line. comm_eol just means
"comment at end of line".
> i think that char class should be <[a-z-]>. <[]> marks a class and the -
> needs to be inside it.
Oops, typo.
> the second <sp>* should be <sp>+ as you need whitespace between the
> option and value.
Yes.
> SC> rule devicelayout { <sp>* device <sp>+ $name := (/dev/\w+) <comm_eol>
> the \w+ after /dev/ needs to be more accepting as i think some devices
> could be in subdirs
No, by stipulation. :) This is Linux, without devfs.
> that is how i understand it. the grammar automatically build a tree of
> the grabs with hash keys being the rule names and multiples (rules with
> quantifiers) being arrays.
Great.
--
You advocate a lot of egg sucking but you're not very forthcoming with the
eggs. - Phil Winterbottom (to ken)