Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 rifling through the Monastery: (4)
As of 2016-08-27 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (379 votes). Check out past polls.