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