Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Delimited Backtracking with Regex

by McDarren (Abbot)
on Apr 21, 2006 at 01:59 UTC ( #544753=note: print w/replies, xml ) Need Help??


in reply to Delimited Backtracking with Regex

I'm not sure if I understand this correctly - but I suspect that all you really need to do is split. eg:

Update: - looks like I obviously didn't even remotely understand what you were after, so just pretend I didn't post the below :)

#!/usr/bin/perl -w use strict; use Data::Dumper::Simple; my $string = "TXXXABCDGXXXCCCDTGYYYCCCYYYCC"; my @wanted = split /XXX|YYY/, $string; print Dumper(@wanted);
Gives:
@wanted = ( 'T', 'ABCDG', 'CCCDTG', 'CCC', 'CC' );
Is that what you were after?

Cheers,
Darren :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2020-12-01 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (22 votes). Check out past polls.

    Notices?