Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: regex replacement help

by samarzone (Pilgrim)
on Mar 30, 2011 at 07:35 UTC ( #896331=note: print w/replies, xml ) Need Help??


in reply to Re: regex replacement help
in thread regex replacement help

Following would be a better approach to keep the splitting pattern as well.

@out = split /(~)/, $string
--
Regards
- Samar

Replies are listed 'Best First'.
Re^3: regex replacement help
by jaimon (Sexton) on Mar 30, 2011 at 17:06 UTC

    Here, the splitting pattern would be a separate element

    - J

      Oh yes. I didn't notice that. Thanks.

      I should have written a positive look behind regex

      @out = split /(?<=~)/, $string;
      --
      Regards
      - Samar

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2016-09-29 19:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (558 votes). Check out past polls.