Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Regex Pipe Return

by BillKSmith (Priest)
on Dec 27, 2012 at 03:00 UTC ( #1010441=note: print w/replies, xml ) Need Help??


in reply to Regex Pipe Return

I think that you want to return the matched characters.
use strict; use warnings; my $string = 'XXXXXXXXXXABXXXXXXXXX'; my ($match) = $string =~ m/X{10}([AB]{2})X{9}/; print $match;

OUTPUT:

AB

UPDATE: Added Output

Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010441]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-02-28 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (405 votes). Check out past polls.