Need help with regex to find and replace


#1

Hallo all,

i would really appreciate if someone could help me with a regex.

I have different font icons:


Some of them have the attribute aria-hidden=“true” and some of them they don’t. I want to target all icons without the attribute and add them the attribute:

For example the icon

should be replaced with

Any ideas?


#3

I’m guessing those icons were html code? On here you’ll have to put html into code blocks for others to read it, i.e.:

`<img src="source.gif"/>`

#5
icons: 

<i class="fa fa-sign-in"></i>
<i class="fa fa-user-plus"></i>
<i class="fa fa-tag"></i>
<i class="fa fa-home" aria-hidden="true"></i>

<i class="fa fa-sign-in"></i>
should replaced with

<i class="fa fa-sign-in" aria-hidden="true"></i>

#6

Sorry for the multiple posts. Tried to figure out how to add the html code. Thanks Songworks


#7

SEARCH: (class=\"[^"]+\")>
REPLACE: $1 aria-hidden="true">


#8

Thank you very much danPadric!