[Flashcoders] captured or non-captured named group back references in AS3 regex

2010-06-18 Thread Anthony Pace
I know you can have named groups, but are there named group back 
references in AS3?  if so, do you have any examples of it working? it 
isn't working for me if I try \k, \


The funny thing about this situation is that I know that you can access 
them after exec of a regex, and I wonder why they would allow one way of 
using them and not the other?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] captured or non-captured named group back references in AS3 regex

2010-06-18 Thread kennethkawam...@gmail.com
(?Pgroup)

Is this what you are looking for?
-- 
Kenneth Kawamoto
http://www.materiaprima.co.uk/

On 18 June 2010 15:39, Anthony Pace  wrote:
> I know you can have named groups, but are there named group back references
> in AS3?  if so, do you have any examples of it working? it isn't working for
> me if I try \k, \
>
> The funny thing about this situation is that I know that you can access them
> after exec of a regex, and I wonder why they would allow one way of using
> them and not the other?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] captured or non-captured named group back references in AS3 regex

2010-06-18 Thread kennethkawam...@gmail.com
Can you access using

result.name

?
-- 
Kenneth Kawamoto
http://www.materiaprima.co.uk/

On 18 June 2010 15:39, Anthony Pace  wrote:
> I know you can have named groups, but are there named group back references
> in AS3?  if so, do you have any examples of it working? it isn't working for
> me if I try \k, \
>
> The funny thing about this situation is that I know that you can access them
> after exec of a regex, and I wonder why they would allow one way of using
> them and not the other?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] captured or non-captured named group back references in AS3 regex

2010-06-18 Thread kennethkawam...@gmail.com
I wasn't reading your post properly :) Have you tried (?P=name) ? (or
you may want try \n)
-- 
Kenneth Kawamoto
http://www.materiaprima.co.uk/

On 18 June 2010 15:39, Anthony Pace  wrote:
> I know you can have named groups, but are there named group back references
> in AS3?  if so, do you have any examples of it working? it isn't working for
> me if I try \k, \
>
> The funny thing about this situation is that I know that you can access them
> after exec of a regex, and I wonder why they would allow one way of using
> them and not the other?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] captured or non-captured named group back references in AS3 regex

2010-06-23 Thread Anthony Pace

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)   \k  worked fine for me; yet, why ?P ? is it an 
allusion to python cause they did it first? if so why not use \g 
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='(?:(?Pfeb)(?:\s|/)(?P2[0-9]|19)|(?Pmar)(?:\s|/)(?P[0-1]?[0-9]|20))(?:\s|/)(?P\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='(?Pfeb|mar)(?:\s|/)(?P(?<=feb(?:\s|/))(?:19|2[0-9])|(?<=mar(?:\s|/))(?:1?[0-9]\b|20))(?:\s|/)(?P(?:\d\d){1,2})')
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders