I have a whole array of regexp queries to make recursively going through the string in order.
Is there a way I can do it all with 1 call such as (doesn't work)?
str.replace(/query1|query2|query3|query4|...|[0-9]+|[^]/,
"reslt1|reslt2|reslt3|reslt4|...|procNumb|procChar");
It need only work in Firefox. Right now I'm stuck with:
str.replace(... ,function(a,b,c){if (a=="query1") return "reslt1"; ..............});
Thanks!
Edit: Sorry if confusing. Goal:
Before: "query1query3x123query2" After: "reslt1reslt3procChar(x)procNumb(123)reslt2"
The main thing is I need I to process the string 1 fragment at a time recursively, so I think I must use a super-query like that to match any, or not use regexes at all. I just wonder if there's a way to automatically pair the results to the queries when using lots of pipes. I am not so familiar with javascript regex but I couldn't find anything on mdc unfortunately.