Dear Members!
I have a string
$str = "Total Mobile HONDA Civic, EXI: model 2002, excellent condition,
available for sale. My Phone # is. 042-6832797, My Cell. 0300-4459899, My
Office Cell is0300-5009228, my other mobile no is 0356-4094030, my Friend
Mobile no is . 03226789871";
I want to print all mobile from above string. Mobile code always start from 03.
and not more than 4 digits.
So here I have use this regular expression.
while($str =~ /(\b(0([3](\d\d)))+[-]+\d{7}|\ b(0([3](\d\d)))+\d{7})/g){
print "Your Mobile No. is " . $1 . "\n"; }
Here is the output of while
Your Mobile No. is 0300-4459899Your Mobile No. is 0356-4094030Your Mobile No.
is 03226789871
its Work fine but one mobile no. is missed and that is My Office Cell
is0300-5009228
As you can see its not works because there is no space after the word is So
would you please help me what kind of change is required in above regular
expression.
Best Regards,
Umar