This is a migrated thread and some comments may be shown as answers.

Problems using regular expression with capturing and non-capturing groups

0 Answers 96 Views
Extensions and Customization
This is a migrated thread and some comments may be shown as answers.
Pilar
Top achievements
Rank 1
Pilar asked on 19 Feb 2016, 01:54 PM
I was having problems to replace some strings in the response. To look for the pattern I have using a regular expression, but I only want to replace one part of the expression. I was trying to define capturing groups with () and non- capturing groups with (?:). I have tested in some webs about regular expression and it works, but in fiddler doesn´t.

For example. I have this code:  

var oRegEX=/(?:(value="))(NOIA)/gi;
 oBody = oBody.replace(oRegEX, "xxxxxx");

I look for expressions like value="NOIA" but I only want to replace the word NOIA like this value="xxxxxx"

It has to be replaced the string NOIA but it replaces all value the string .

Could you help me??

No answers yet. Maybe you can help?

Tags
Extensions and Customization
Asked by
Pilar
Top achievements
Rank 1
Share this question
or