> From: Gregory Ewing <greg.ew...@canterbury.ac.nz> > To: python-list@python.org > Is 'dash' the same as 'literal("-")'? > Yes, it's a convenience method, like 'dot' and 'underscore'. The code I pasted is from the unit tests, where I use the different methods to push coverage up.
> Is there any difference between 'then' and 'followed_by'? > Nope, they're synonyms. Same as 'zero_or_more' is the same as 'any_number_of', or 'digit' is the same as 'digits'. Why do some things have __ in front of them? Is there a > difference between 'literal' and '__literal'? > Er... looks like a garblement in my post! There are no __ in my original :( It should be: north_american_number_re = (RE().start .literal('(').followed_by.exactly(3).digits.then.literal(')') .then.one.literal("-").then.exactly(3).digits .then.one.dash.followed_by.exactly(4).digits.then.end .as_string()) Thanks for the comments! Cheers b
-- http://mail.python.org/mailman/listinfo/python-list