Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Debugging Regexes

by fletcher_the_dog (Friar)
on Jun 28, 2004 at 17:49 UTC ( [id://370270]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    "(?=hello)" matches "hello"
    ".*"        matches "hello Ga"
    "[^G]"      matches "g"
    "[^a]"      matches "s"
    ".*"        matches nothing
    
  2. or download this
    ( "hello Gags" =~ /^(?=hello)(?!.*Ga/ )&& print ("Matched") || print (
    +"Unmatched")
    
  3. or download this
    use strict;
    ( "hello Gags" =~ /^(?=hello)(.*)([^G][^a])(.*)$/ ) ?  matches() : pri
    +nt ("Unmatched");
    ...
    $1 = 'hello Ga'
    $2 = 'gs'
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-23 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found