Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > backreferences to two sets of slashes

Reply
Thread Tools

backreferences to two sets of slashes

 
 
Eric smith
Guest
Posts: n/a
 
      11-06-2011
if ( $foo =~ /(\d\d)-(\d\d)-\d\d\d\d/ and $bar =~ /(\d?\d)\d\d)\d\d)/ )
{

# How do I match here the the two fields of $foo ?
# Or is it not possible in a single construction?
# $bar of course gives its hours minutes and seconds in $1, $2 and $3
}

Thanks

--
Eric Smith
 
Reply With Quote
 
 
 
 
Helmut Richter
Guest
Posts: n/a
 
      11-06-2011
On Sun, 6 Nov 2011, Eric smith wrote:

> if ( $foo =~ /(\d\d)-(\d\d)-\d\d\d\d/ and $bar =~ /(\d?\d)\d\d)\d\d)/ )
> {
>
> # How do I match here the the two fields of $foo ?
> # Or is it not possible in a single construction?


What about

if ("$foo===$bar" =~
/(\d\d)-(\d\d)-\d\d\d\d/.*===.*(\d?\d)\d\d)\d\d)/)

--
Helmut Richter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backreferencing through two sets of slashes Eric Smith Perl Misc 1 11-08-2011 03:39 AM
ApplicationDispatcher.requestURI starting with two slashes Peter Horlock Java 2 11-16-2010 11:57 PM
two axis, two data sets GD::Graphic java Perl Misc 7 12-08-2006 12:55 PM
RegEx: odd number of slashes? and too many slashes? Dan Wilkin Perl Misc 1 07-17-2006 03:47 AM
String replacement( 2 slashes-> 4 slashes ) qazmlp Java 5 04-07-2004 10:26 PM



Advertisments