Correct regex for non-sequential numbers in Edit Replace in files

I’m trying to use “Edit Replace in files” to find/delete a long list of code with non-sequential numbers in them such as :
id=“i251”
id=“i253”
id=“i274”
id=“i288”
id=“i289”
and on down the file.
I just couldn’t figure this one out !
How can I do that ?
What is the correct regex for this ?

I should note that these are inside a link anchor tag
<a id=“i54”> </a>

Hmm…

/id=\"i[0-9]+\"/

UPD:

If you also want to delete <a> tag, the regex will be

/\<a.+id=\"i[0-9]+\"\>.+?\<\/a>/

Don’t forget to check “Regex” when searching.

Your regex won’t found something like id=“i1337” :wink:

“Don’t forget to check “Regex” when searching.”

OK ! thanks, that’s what I was over looking. Gheez, all this time over such a simple thing !
Thanks again ! Now it works !

i\d+ does it I think.

@Charles, Glad you’re sorted!

  • Carey
1 Like

Yep, you’re right. \d+ works fine!

1 Like

With regex it pays to be explicit :wink:

1 Like