Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Regex Pipe Return

by BillKSmith (Chaplain)
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


Comment on Re: Regex Pipe Return
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2014-08-29 00:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls