develooper Front page | perl.perl6.language | Postings from August 2010

regex and

Thread Next
From:
philippe.beauchamp
Date:
August 10, 2010 10:30
Subject:
regex and
Message ID:
3823C3443A7CA34BA4338754939C12E70131EBA40D@MBX08.bell.corp.bce.ca

Hi there...
New to the list and getting to understand perl6 after a bit of a hiatis from the Perl world.

I'm working my way through the new grammar syntax trying to implement some useful modules, and was wondering if there is a mechanism within the grammar constructs to allow two rules to apply simultaneously in parallel (not sequence).

In other words... I want to say that for a rule to pass it must pass two contained rules completely.

Ie:
token abc
{
                'abc'
}

rule TOP
{
                ^
                [
                & <alpha>*
                & <!abc>
                ]
                $
}


Such that the TOP rule would only match if a matching string consisted entirely of alpha's AND did not contain the letter sequence "abc" anywhere in it.

(*note I know the & notation isn't legit ;)






Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About