sanket vaidya wrote:
From: Manasi Bopardikar [mailto:[EMAIL PROTECTED]
Hi,
I have a regex --- $array[3]=~/[M|T|W|TR|F]\s[M|T|W|TR|F]\s(.*?)/;
I want to extract the value of expression highlighted in red.Is there any
way to do it.
You want to capture character "?" means zero or one time r
Manasi Bopardikar wrote:
Hi,
Hello,
I have a regex --- $array[3]=~/[M|T|W|TR|F]\s[M|T|W|TR|F]\s(.*?)/;
I want to extract the value of expression highlighted in red.
My email reader only displays black text on a white background, there is
no "red" here. If you could show us the actual pat
Manasi Bopardikar wrote:
I have a regex --- $array[3]=~/[M|T|W|TR|F]\s[M|T|W|TR|F]\s(.*?)/;
That regex makes little sense; you need to read up on [...] style
character classes. And ending the regex with a non-greedy (.*?) will
probably make it not capture anything.
perldoc perlre
I w
s"
Output:
time = 8:00AM - 10:20
days = M,W
-Original Message-
From: Manasi Bopardikar [mailto:[EMAIL PROTECTED]
Sent: Friday, July 18, 2008 10:06 AM
To: 'sanket vaidya'
Subject: RE: Extract the desired value from a regex
String is
M W 8:00AM - 10:20
I want to put M,W in days
o capture &
what to capture?
Thanks & Regards,
Sanket Vaidya
Patni Computer Systems Limited
-Original Message-
From: Manasi Bopardikar [mailto:[EMAIL PROTECTED]
Sent: Friday, July 18, 2008 9:52 AM
To: 'sanket vaidya'
Subject: RE: Extract the desired value from a regex
Ca
$1 does not work because you are using metacharacter "?" in regex. Use \Q &
\E to capture.
Thanks & Regards,
Sanket Vaidya
Patni Computer Systems Limited
A 78/9, GIDC, Electronics Estate
Sector - 25, Gandhinagar - 382 016
Gujarat, India
Tel: 91-79-23240905 Ext: 243
-Original Message-
Fro