Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: How to use regular expression for this?

by QM (Parson)
on Aug 12, 2005 at 23:09 UTC ( [id://483455]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to use regular expression for this?
in thread How to use regular expression for this?

my $result = $pattern ^ $_;
This XORs $pattern and $_ together, and stores it in $result.
my $matches = $result =~ tr/\0//;
This counts the number of matches, and puts that into $matches.

-QM
--
Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://483455]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-12-13 03:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (67 votes). Check out past polls.