Adding escape chars to email address 
Author Message
 Adding escape chars to email address

It's been a while since I have done regular expressions.



How do I do this?

Regards
Ry



Sat, 24 Jul 2004 10:33:57 GMT  
 Adding escape chars to email address

Quote:
> It's been a while since I have done regular expressions.

It is not a regular expression issue here.

Quote:



Then you either have to wrap it into a different pair of quotes:






And there is no need to escape the dot: It is only special in regular
expressions.

If you, however, want to use an email as a pattern in a regex, then you
do have to escape them. But let Perl do that for you:

    /\Q$email/


already gone for a long time.

Tassilo
--
$_=q!subJust{another()};subanother{Perl()};subPerl{hacker()};subhacker{map

b/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;



Sat, 24 Jul 2004 10:40:10 GMT  
 Adding escape chars to email address

Don't the other kids make jokes about your name?

Quote:
> It's been a while since I have done regular expressions.



this is surely (heaven knows) not what you want, but


perldoc -f quotemeta

HTH

--






Sat, 24 Jul 2004 14:47:44 GMT  
 Adding escape chars to email address

                                             ^^^^^^^^^^^^^^^^^^^^^^^^^

But only in 5.6.1 (see perldelta.pod).

The above was a fatal compile-time error in earlier perl versions.

But if you have "use strict" enabled (as everybody should), then you
get a fatal compile-time error (a different one) with 5.6.1 too.

--
    Tad McClellan                          SGML consulting

    Fort Worth, Texas



Sat, 24 Jul 2004 15:12:24 GMT  
 Adding escape chars to email address

Quote:




>                                              ^^^^^^^^^^^^^^^^^^^^^^^^^

> But only in 5.6.1 (see perldelta.pod).

Oh, right you are. This info was well hidden and buried in the notoriously
untidy perldelta. Thanks for the info, I wasn't aware of it.

Tassilo
--
$_=q!subJust{another()};subanother{Perl()};subPerl{hacker()};subhacker{map

b/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;



Sat, 24 Jul 2004 15:24:09 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to add \ to an email address

2. Finding an email address by ip address

3. sending an email to two different email addresses

4. sendmal doesn't return emails to unknown email-addresses

5. escape special chars before loading into MySQL

6. interpolate escaped chars in string

7. backslash escaping not metacharacters in a char class

8. is there a way to escape special chars

9. which chars to escape in reg.exp?

10. Problem with escaped octal chars > 127

11. Newbie - Escaping special chars in forms

12. reg ex: validating an email address

 

 
Powered by phpBB® Forum Software