On 6/18/2010 1:07 PM, kennethkawam...@gmail.com wrote:
I wasn't reading your post properly :) Have you tried (?P=name) ? (or
you may want try \n)
oops, sorry for not getting back to you. Thanks for the response. I
figured it out too by looking in the docs.
Having to type the stupid P after the ? is what got me for a few minutes.
(?P<name>) \k<name> worked fine for me; yet, why ?P<name> ? is it an
allusion to python cause they did it first? if so why not use \g<name>
which does not seem to work?
Is that, the allusion to Python, the reason why I can't get alternating
with groups of the same name, the .net way, to work either?
e.g. trying to specify only dates that fall into Pisces from
dob='feb/22/1980'
dob='mar 22 1922'
dob='nov 11 1988'
dob='mar/12/1956'
dob='feb 21 82'
dob='mar/12/1956'
This won't work even with the P, because python doesn't allow groups of
the same name even in a logical OR alternation:
(?:dob='(?:(?P<month>feb)(?:\s|/)(?P<day>2[0-9]|19)|(?P<month>mar)(?:\s|/)(?P<day>[0-1]?[0-9]|20))(?:\s|/)(?P<year>\d{2,4})))
and this is the best alternative I could come up with; yet, then again,
I am obviously in dire need of work with regex
(?:dob='(?P<month>feb|mar)(?:\s|/)(?P<day>(?<=feb(?:\s|/))(?:19|2[0-9])|(?<=mar(?:\s|/))(?:1?[0-9]\b|20))(?:\s|/)(?P<year>(?:\d\d){1,2})')
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders