in reply to Help with regex - find captured pattern twice

For your problem with "c/c(+1)" there is are Look-Around Assertions, check perlre. For example, (?=pattern) matches the pattern but does not include it in the match.

Also, in your code snippet, can you please include the missing $steady_states{$var}, so that the code becomes executable.

Replies are listed 'Best First'.
Re^2: Help with regex - find captured pattern twice
by pachydermic (Beadle) on Apr 10, 2013 at 13:05 UTC
    That might not be the best solution, since my design is kind of flawed, but it is most certainly the easiest. Thank you. I learned yet another thing about regex today! Of course I will probably forget it by the next time I need it... Sorry about not including the hash - I cut this from a much larger program.