Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Regex with Backslashes

by anita2R (Scribe)
on May 17, 2020 at 14:39 UTC ( [id://11116857]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $regex = '(?<!\\\),';
    split( /$regex/, "$text" );
    
  2. or download this
    1
    Something\,\text\text\0x2B
    X
    99
    
  3. or download this
    1
    This is a problem->\,B
    2
    
  4. or download this
    my $regex = '(?<!:),|(?<=[:]{2}),';
    my $text = '1,This:, is not a problem->::,B,2';
    my @test = split( /$regex/, "$text" );
    ...
    foreach( @test ) {
        print "$_\n";
    }
    
  5. or download this
    1
    This:, is not a problem->::
    B
    2
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found