Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Regexp: How to match in middle but not the ends?

by ikegami (Patriarch)
on Jul 30, 2006 at 18:41 UTC ( [id://564648]=note: print w/replies, xml ) Need Help??


in reply to Re: Regexp: How to match in middle but not the ends?
in thread Regexp: How to match in middle but not the ends?

It incorectly matches "C" in "-C-". (Two chars minimum.)

$_ = '---LL--C----LCSH-------CSHL-------LCSLH-------LCCHLSHCL----'; while (m/([A-Z]+)/g) { ($s = $1) =~ s/^L+|L+$//g; print "$s\n" if length $s >= 2; }

Log In?
Username:
Password:

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

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

    No recent polls found