Daniel Abel
Daniel Abel

Reputation: 25

Match all attributes of all tags except the specific tag

Good morning, I'm trying to use regular expressions to select all attributes, but I don't want to select the attributes of a specific tag. My code:

/("([^"]*)\")/g

Example: https://regexr.com/66nup

The code works fine, I just want to exclude the attributes from the "Variable" tag.

Upvotes: 0

Views: 47

Answers (1)

leimapapa
leimapapa

Reputation: 26

Is something like this what you're looking for?

/<variable.*?>/g

That removes just the <variable includable id='image'> from your linked example. Or do you also need it to remove the </b:includable> right after?

Upvotes: 1

Related Questions