Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Regex. Combination of words block. Need help.

by tybalt89 (Monsignor)
on Feb 09, 2020 at 15:48 UTC ( [id://11112688]=note: print w/replies, xml ) Need Help??


in reply to Regex. Combination of words block. Need help.

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11112671 use warnings; my $string = 'aaa, bbb, ccc,ddddd;eee-12345abc Qwerty'; my @a; $string =~ m{ (?<![-\w/])[-\w/] .* (?<=[-\w/])(?![-\w/]) (?{ push @a, $& }) (*FAIL) }x; use Data::Dump 'dd'; dd \@a;

Outputs:

[ "aaa, bbb, ccc,ddddd;eee-12345abc Qwerty", "aaa, bbb, ccc,ddddd;eee-12345abc", "aaa, bbb, ccc,ddddd", "aaa, bbb, ccc", "aaa, bbb", "aaa", "bbb, ccc,ddddd;eee-12345abc Qwerty", "bbb, ccc,ddddd;eee-12345abc", "bbb, ccc,ddddd", "bbb, ccc", "bbb", "ccc,ddddd;eee-12345abc Qwerty", "ccc,ddddd;eee-12345abc", "ccc,ddddd", "ccc", "ddddd;eee-12345abc Qwerty", "ddddd;eee-12345abc", "ddddd", "eee-12345abc Qwerty", "eee-12345abc", "Qwerty", ]

Log In?
Username:
Password:

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

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

    No recent polls found