That answers my question.
Thanks Robert
On Wed, Dec 11, 2013 at 10:35 AM, punit jain wrote:
>
> Thanks Shlomi, thats a good idea. However at the same time I was trying to
> understand if something is wrong in my regex. Why would $2 capture the
> number as I have used :-
>
> (?:(91\d{10}|0\d{10}|[7-9]\d{9}|0\d{11})|(?:(?:ph|cal)(\d+)))
>
Hi,
You can try the below pattern.
if($line=~/([0-9]{3,})/gs) {
print $1;
}
Thanks,
Vijaya
--
From: punit jain
Sent: 12/11/2013 9:07 PM
To: beginners@perl.org
Subject: Regex not working correctly
Hi,
I have a requirement where I need to capture phone
Thanks Shlomi, thats a good idea. However at the same time I was trying to
understand if something is wrong in my regex. Why would $2 capture the
number as I have used :-
(?:(91\d{10}|0\d{10}|[7-9]\d{9}|0\d{11})|(?:(?:ph|cal)(\d+)))
This would in my understanding match either number with regex
91
On Dec 11, 2013, at 7:34 AM, punit jain wrote:
> Hi,
>
> I have a requirement where I need to capture phone number from different
> strings.
>
> The strings could be :-
>
>
> 1. COMP TEL NO 919369721113 for computer science
>
> 2. For Best Discount reach 092108493, from 6-9
>
> 3. Your b
Hi punit,
On Wed, 11 Dec 2013 21:04:39 +0530
punit jain wrote:
> Hi,
>
> I have a requirement where I need to capture phone number from different
> strings.
>
> The strings could be :-
>
>
> 1. COMP TEL NO 919369721113 for computer science
>
> 2. For Best Discount reach 092108493, from 6-9
Hi,
I have a requirement where I need to capture phone number from different
strings.
The strings could be :-
1. COMP TEL NO 919369721113 for computer science
2. For Best Discount reach 092108493, from 6-9
3. Your booking Confirmed, 9210833321
4. price for free consultation call92504060
5.