 |
|
Home:
Perl Programming Help:
Regular Expressions:
Regex Help:
Edit Log
|
|

zkr2133
New User
Sep 18, 2012, 5:14 PM
Views: 4572
|
Hey Guys I am trying to find a way to match a phone number such as 7195551212, but I can use only "one" 5 in the search. I know how to do it with three 5's for the match expression but using just one 5 seems to be an impossible task. My attempt so far:
#!/usr/bin/perl @_ = (<>); foreach $matchvar (@_){ if ($matchvar =~ /555/){ print "$matchvar\n"; } } Any help is appreciated.
(This post was edited by zkr2133 on Sep 18, 2012, 6:02 PM)
|
|
|
Edit Log:
|
|
Post edited by zkr2133
(New User) on Sep 18, 2012, 5:15 PM
|
|
Post edited by zkr2133
(New User) on Sep 18, 2012, 5:18 PM
|
|
Post edited by zkr2133
(New User) on Sep 18, 2012, 5:19 PM
|
|
Post edited by zkr2133
(New User) on Sep 18, 2012, 5:22 PM
|
|
Post edited by zkr2133
(New User) on Sep 18, 2012, 5:27 PM
|
|
Post edited by zkr2133
(New User) on Sep 18, 2012, 6:02 PM
|
|
|  |