Rather than using regexs for this job, I'd recommend to use Text::CSV or Text::CSV_XS to parse the lines of the file into a list and simply add the tags on an element by element basis.
IMHO this is a cleaner approach from a software engineering point of view, but more importantly you're sure that CSV will be handled correctly in all cases.
Hope this helps, -gjb-
In reply to Re: newbie regex question: substituting repeating occurences for different replacements
by gjb
in thread newbie regex question: substituting repeating occurences for different replacements
by RuyLopez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |