Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: zero-width assertions in perl regular expression

by spadacciniweb (Deacon)
on Feb 28, 2009 at 10:44 UTC ( #747120=note: print w/replies, xml ) Need Help??


in reply to zero-width assertions in perl regular expression

Simple script to explain the difference:
use strict; use warnings; use YAPE::Regex::Explain; for my $regexp ('\babc\z','\babc\Z') { print YAPE::Regex::Explain->new($regexp)->explain, "\n"x3; }
print:
The regular expression: (?-imsx:\babc\z) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- \b the boundary between a word char (\w) and something that is not a word char ---------------------------------------------------------------------- abc 'abc' ---------------------------------------------------------------------- \z the end of the string ---------------------------------------------------------------------- ) end of grouping ---------------------------------------------------------------------- The regular expression: (?-imsx:\babc\Z) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- \b the boundary between a word char (\w) and something that is not a word char ---------------------------------------------------------------------- abc 'abc' ---------------------------------------------------------------------- \Z before an optional \n, and the end of the string ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------

(($_="Mzz ojjdloobnf jt uvy5502383")=~y~b-zg2-5c96-81~a-z0-9~s)=~s~~~s; print

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://747120]
help
Chatterbox?
[Corion]: Weird - this "Install our backdoor SDK" spam is persistent. And I get the feeling it's not even automated, as it seems to be a re-forward of each mail, maybe even manually. Ah well, a quick rule in Thunderbird will move them to Spam automatically now :D
[Corion]: (the "backdoor SDK" is for distributing my software with an included backdoor, not for backdooring my own machine)
[marto]: ask for a trial
[marto]: then trick them into running your app
[marto]: once you have access, remove your email address from their system :P

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-05-25 14:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?