Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Help please

by steveatmarz (Initiate)
on Mar 11, 2008 at 19:50 UTC ( [id://673593]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Help please
in thread Help please

I have searched far and wide and I can't find how to accomplish the printing of the trailing char from character set .?,

Replies are listed 'Best First'.
Re^4: Help please
by davidrw (Prior) on Apr 26, 2008 at 03:46 UTC
    Here's two different ways:

    One way is that you could capture the character class match with parens, and then refer to it (in this case) as $2.
    /it (.*)([.?,])$/i and print $1, $2, $/;

    Another way would be to simply move the character class to be inside the existing capturing parens:
    /it (.*[.?,])$/i and print $1, $/;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found