Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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: (8)
As of 2018-06-24 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?