Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Regex Pipe Return

by BillKSmith (Vicar)
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 studying the Monastery: (5)
As of 2017-11-23 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (334 votes). Check out past polls.

    Notices?