Thanks, I think I finally found that idiomatic solution.
I have a string that I want to match against a regular expression.
However, group capture is not supported :(
So, except for the first two elements, I can simply split the string upon a
comma delimiter
Now, I need to match against each of
On Thu, Nov 18, 2010 at 12:52 PM, Jeff C. Britton j...@iteris.com wrote:
I have a string that I want to match against a regular expression.
However, group capture is not supported :(
Here's an approach using peg.ebnf. You'll also need math.parser for
'stringnumber' and peg for 'ignore'.
EBNF:
I'm having trouble with ! Is there some combination of ![a-zA-Z0-9]+ that
will match white-space or punctuation?
On Wed, Nov 17, 2010 at 4:33 PM, Jeff C. Britton j...@iteris.com wrote:
Thanks,
I like this. I will need to look into PEG.
--Jeff
-Original Message-
From: Chris
On Thu, Nov 18, 2010 at 1:42 PM, Jim mack j...@less2do.com wrote:
I'm having trouble with ! Is there some combination of ![a-zA-Z0-9]+ that
will match white-space or punctuation?
There's a few ways you can do it. You should be able to use
parenthesis to use '!':
alpha = [a-zA-Z0-9]
rule =
TUPLE: digits text ;
TUPLE: punc text ;
TUPLE: upper text ;
TUPLE: lower text ;
TUPLE: whitespace text ;
EBNF: categorize
digits = [0-9]+ = [[ string digits boa ]]
lower = [a-z]+ = [[ string lower boa ]]
upper = [A-Z]+ = [[ string upper boa ]]
punc = [!-/:-...@[-`{-~]+ = [[ string punc boa ]]
On Thu, Nov 18, 2010 at 1:53 PM, Jim mack j...@less2do.com wrote:
ws = | \t = [[ string whitespace boa ]]
Change this to:
ws = ( | \t) = [[ string whitespace boa ]]
In the first case the = is binding to the \t part of the clause.
Chris.
--
http://www.bluishcoder.co.nz