in reply to Re: group things?
in thread group things?

Joost, your code works perfect for me... Unfortunately, I don't seem to understand much of what you do... but thank you for your time...

Replies are listed 'Best First'.
Re^3: group things?
by Joost (Canon) on Apr 25, 2008 at 22:34 UTC
    As someone else already hinted, you would probably benefit from reading perlretut and pos.

    It may seem like overkill for this problem but learning regular expressions will make string processing problems like this a lot easier. And almost all serious programming languages today have a regular expression library very much like perl's, so chances are high you'd be able to use that knowledge if you're using some other language too.

      Oh, backreferences were the catch then? I saw about it in the tutorial... Thank you guys, both of you!
Re^3: group things?
by Anonymous Monk on Apr 25, 2008 at 22:53 UTC
    OK, Joost's code works, now it's time for you to go to work.

    The code uses only a regex and two built-in functions, pos and length, and string concatenation (the . operator). Time to apply Your Mother's suggestions about documentation access and do some reading. Then, maybe try some variations and see what happens. After that, specific questions will usually elicit pertinent answers.