in reply to Splitting and maintaining the delimiter

Also note the following (from perldoc -f split):

If the PATTERN contains parentheses, additional list elements are created from each matching sub­ string in the delimiter. split(/([,-])/, "1-10,20", 3); produces the list value (1, '-', 10, ',', 20)

I'm not very sure how useful this is for you, but then again, I'm not very sure how useful it is to keep the delimiters in the string :-).

-- Joost downtime n. The period during which a system is error-free and immune from user input.

Replies are listed 'Best First'.
Re^2: Splitting and maintaining the delimiter
by Preceptor (Deacon) on Mar 07, 2007 at 10:52 UTC
    And despite being a while out of date, this has just proven very useful for some of my messing around :) Thanks.