Hello everybody
i have this code in fiddlerScript :
if(oSession.HostnameIs("example.com")) {
oSession.utilDecodeResponse();
oSession.utilReplaceRegexInResponse('text-align: left; width: 120px;">[^<]*</span>','text-align: left; width: 120px;">xxxxxxxxx</span>');
oSession.utilReplaceRegexInResponse('text-align: left; width: 145px;">[^<]*</span>','text-align: left; width: 145px;">yyyyyyyy</span>');
---------------------------------------
In the webpage there is more element that will begin like that : text-align: left; width: 145px;
my question is : how can i replace only the first string that will seen on the webpage , not all ?!?!
thanks !
The utilReplaceRegexInResponse() method does not allow customizing the number of replacements. You can use another method - utilReplaceOnceInResponse() to replace only once, but it does a simple string replace, not using regular expressions.
If you want to use regular expressions, then you have to use a feature called negative lookbehind (?<!...) that allows you to replace only the first match. Here is an example of how to use it in your case: Regex example
The search string should become