Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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


Comment on Re^2: regex replacement help
Download Code
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 having an uproarious good time at the Monastery: (8)
As of 2014-10-01 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (386 votes), past polls