Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

RE: vertical regex in a matrix?

by ncw (Friar)
on Sep 12, 2000 at 00:41 UTC ( [id://31978]=note: print w/replies, xml ) Need Help??


in reply to vertical regex in a matrix?

This was my attempt
my $string = <<EOF; xxxYYxxxYYxxx YY YY 4Y 4X 4Y 4Y YY YY EOF print "1: $string"; $string =~ s/ (?: (?<=x) | \G ) (Y) (?= Y* x) /x/gx; print "2: $string"; $string =~ s/ (?<= ^ (.*) Y .* $ ^ \1 ) (4) (?= .* $ ^ \1 Y .* $ ) /Y/mgx; print "3: $string";
The first part to match the horizontal parts works fine. The second part to match the verticals doens't work though for two reasong
  1. It is going to match the same string horizontally in each case up to the vertical replacement (which wasn't specified)
  2. Perl gave this message "variable length lookbehind not implemented" when I tried it ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-25 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found