Reputation: 144
I have this batch process where I need to refactor svg path's. Because I have many occurrences in my project and I'm a lazy guy, I prefer to solve this task with find and replace as Regular Expression.
What I have:
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/_ui/desktop/common/images/svg/icons.svg#icon-arrow--white"></use>
What I want in the end:
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-arrow--white"></use>
My regex looks like this:
xlink="(.*)#
and its valid for my string on http://regex-testdrive.com/en/dotest and other sites.
How come, that if I use this expression in PhpStorm that it is not valid. If someone of you guys could provide me a hint, why I get 0 occurrences in PhpStorm with my RegEx, I'd be glad.
Upvotes: 1
Views: 989
Reputation: 73251
Next to the field where you input your search string (in your case your regex), there's a box to enable regex in search:
Simply check Regex
, the regex is working then.
Upvotes: 0
Reputation: 43169
You can use:
xlink:href="[^"]*"
And replace the occurences with xlink:href="#icon-arrow--white"
, see a demo on regex101.com.
Upvotes: 1