Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Pattern Matching Confusion

by bofh_of_oz (Hermit)
on Aug 11, 2005 at 14:04 UTC ( #482961=note: print w/ replies, xml ) Need Help??


in reply to Pattern Matching Confusion

Your code is trying to match a specific string, not a string of certain length. If you want any string between any two tags(the same tags) that is of specific length, then use a regex like this:

if ($record =~ /<(.+)>([^<>]{58})<\/\1>/g) {print "$2\n";}

--------------------------------
An idea is not responsible for the people who believe in it...


Comment on Re: Pattern Matching Confusion
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2015-07-05 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls