Lets say this is my code
Using result variable I can access the data and get either '111' or '22222'.
var aa = "aaa111bbb22222";
var result = (aa.match(/aaa(\d+)bbb(\d+)/));
Is it possible to use the 'replace' method with these results? In other words make something like this work
I can't use a 'match' method to get the data then use a replace because I may have more then one thing to replace, in other words my string might be like this:
aa.replace(/aaa(\d+)bbb(\d+)/),'first number' + + ', second number:' );
"aaa534589345bbb5834573459 some text here aaa5465bbb342342"