Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > @ in regular expressions

Reply
Thread Tools

@ in regular expressions

 
 
Chris Sendall
Guest
Posts: n/a
 
      06-24-2005
Recent upgrade to linux server (and move to perl 5.8.0) seem to have
broken regexp recognition of a string of text to be an e-mail address

This test program demonstrates the problem

#!/usr/bin/perl -w
use strict;
$_ = '(E-Mail Removed)';
print "text is $_\n";
print "Matches /^[\\w .\@-]+\$/ \n" if /^[\w.@-]+$/;
print "Matches /^[\\w .\\\@-]+\$/ \n" if /^[\w.\@-]+$/;

[\w.@-] used to work now I need to add \ before @

Am I correct in thinking this is a bug.

Chris Sendall

 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      06-24-2005
Chris Sendall wrote:
>
> [\w.@-] used to work now I need to add \ before @
>
> Am I correct in thinking this is a bug.


No. Please study "perldoc perlvar" and read about the variables @+ and @-.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Regular Expressions in ASP.net Jay Douglas ASP .Net 3 11-03-2003 08:09 PM
Regular expressions mark Perl 4 10-28-2003 12:37 PM
perl regular expressions return last matched occurence? Dustin D. Perl 1 08-28-2003 01:51 AM
matching curly braces and regular expressions Dustin D. Perl 0 08-26-2003 11:18 PM
Add custom regular expressions to the validation list of available expressions Jay Douglas ASP .Net 0 08-15-2003 10:19 PM



Advertisments