Re: Backreferencing through two sets of slashes

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Quoted text here. Click to load it

You may need to clarify or provide some actual
data...  If, possibly, you're trying to match
alternate date formats, you might use something
such as this:

if ( /(?| (\d\d) - (\d\d) - (\d)  # format 1
                      |               #  or
          (\d\d?) : (\d\d) : (\d) # format 2
      )/x )
    print "\$1=3D$1 \$2=3D$2  \$3=3D$3\n";

* see perlre for meaning of (?|pattern) "branch
   reset pattern)

Charles DeRykus

Site Timeline