Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Pattern matching of the type?

by jynx (Priest)
on Dec 12, 2001 at 13:00 UTC ( #131191=note: print w/ replies, xml ) Need Help??


in reply to Pattern matching of the type?

some assumptions first:

1) you want at least one number or digit first
2) you want the phrase "/pin"
3) you don't want the phrase "atlast"

The pattern match would be:

m- # match ^(\w|\d)+ # at least one digit or number at the start of a string /pin # followed by the string "/pin" \d{5} # followed by 5 digits -x # ignore whitespace (and comments)
This uses the prefix 'm' so that i can use different pattern match delimiters, in this case the dash. This way i don't have to escape the slash in '/pin', either in the match or in the comments :) This snippet doesn't capture correctly at all, but it should match the pattern i'm assuming you want. Maybe you can be a bit more specific?

jynx


Comment on Re: Pattern matching of the type?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2014-12-26 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls