Quantcast
Channel: Latest Questions on Splunk Answers
Viewing all articles
Browse latest Browse all 13053

Regex error

$
0
0

I am trying to validate that the user has entered their phone number in this format (555) 555-5555. I keep getting this error: Unmatched ) in regex; marked by <-- HERE in m/[([0-9]) <-- HERE ]+[[0-9]-]+[[0-9]+/ at validate.cgi line 46. My code is below. Any help?

sub validate_input { my $valid = "Y"; my $errormsg; if ($phone !~ m/[([0-9])]+[[0-9]-]+[[0-9]+/]) { $valid = "N"; my $errormsg = "enter a valid phone number in format desired."; } return $valid, $errormsg; }


Viewing all articles
Browse latest Browse all 13053

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>