Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > regex backreference
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 19th November 10:25
jg
External User
 
Posts: 1
Default regex backreference



1. backreference
how do I reference and named matched expression in the pattern
suppose I have specified (abc(?<mymatch>,\s+)|(?<mm2>[-/.]))xyz
and if mm2 was matched previously, I want the same matched mm2 char to
be matched after xyz
but if mymtach was matched previously, I want to match space after
space

In order word I want to match only "abc, xyz " , "abc-xyz-","abc/xyz/",
or "abc.xyz."

I must be thick, I tried (?(mm2)<mm2> and my interpretation of
alternation syntax, all end up with syntax error

2. Alternation
I saw the syntax on Microsoft
(?(expression)yes|no)
and
(?(name)yes|no)
How do I make user of yes part?
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666