CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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



zkr2133
New User

Sep 18, 2012, 5:14 PM


Views: 7800
Regex Help

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:

Code
#!/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


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives