[Israel.pm] match & expression Q.

Yosef Meller mellerf at netvision.net.il
Sun Jul 18 00:34:07 PDT 2004

Gaal Yahas wrote:
 > On Sun, Jul 18, 2004 at 09:19:09AM +0300, Ernst, Yehuda wrote:
 >>how do i write a line that will bring me 2 variables with the English 
and the numbers
 > You need a "character class" that contains English letters and numerals:

[bla bla]

 > @vars = $string =~ /([0-9a-z])/gi;

Well, if you don't 'use locale;' then [\w\d] is enough (because \w will
match your locale's letters if you use locale). And I think you forgot a

no locale; # If you used it
@vars = $string =~ /([\d\w])+/gi;

   "No, I do not contain myself,"
   were the last words from the set of self-excluding sets. :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://perl.org.il/pipermail/perl/attachments/20040718/e3e76f43/attachment.pgp 

More information about the Perl mailing list