Hi,
Is there any way to add an incrementing counter in a regex command?
I read that if the search contains a *[0-9], a %0> will add an incrementing number, but I haven't been able to get it to work.
The search text is id=""
The regular expression is : id="*[0-9]"
The replace text is : id="%>"
Any help would be greatly appreciated
Counter of intrement
Try id="[0-9]*" instead of id="*[0-9]".
The asterisk * goes for the match before it, so your original regex searches for any string of consecutive double quote marks, or none at all and requires one and only one digit to follow.
You may use \d for [0-9]. It is shorter and easier.
\d+ = any string of digits requiring at least one = a number
\d* = any string of digits or none at all = nothing or a number
The asterisk * goes for the match before it, so your original regex searches for any string of consecutive double quote marks, or none at all and requires one and only one digit to follow.
You may use \d for [0-9]. It is shorter and easier.
\d+ = any string of digits requiring at least one = a number
\d* = any string of digits or none at all = nothing or a number