i want to add functionality to my script to check if $input{'email'} is in a valid email format (<A HREF="mailto:name@host.doma">name@host.doma</A>in).<br>Is this possible?<br>thanks<br>foobar2k
This may not be a perfect heuristic, but:<br><br>if ($address =~ /^([\w\-_\.]+)@(([\w\-_]+)\.)+([\w]+)$/) <br>{<br> print "This is probably an email address";<br>}<br>else<br>{<br> print "This is definitely not an email address, loser.";<br>}<br><br>Sincerely,<br><br>Tom Anderson<br>CEO, Order amid Chaos, Inc.<br><A HREF="
I suggest you learn how to write your own regular expressions. You can't keep asking people to come up with them for you. How will you know if they are correct or not? There are plenty of sources on the web, just do a search.<br><br>Sincerely,<br><br>Tom Anderson<br>CEO, Order amid Chaos, Inc.<br><A HREF="
The best way to learn is by example, and correct me if i am wrong but is this a technical help forum?<br>If you dont want to help then dont, but otherwise dont criticise the questions.
I didn't mean to criticize but it's not that hard to learn. I think you will find that tutorials are more helpful than just asking someone to do it for you.<br><br>for the http, try this:<br><br>sub check_http<br>{<br> my ($url) = @_;<br> if ($url =~ /^http:\/\/(.*)$/) {return 1;} else {return 0;}<br>}<br><br>Sincerely,<br><br>Tom Anderson<br>CEO, Order amid Chaos, Inc.<br><A HREF="
foobar -- people give their own time to help you and me in these forums <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.