S
S
Stepan Voevodin2020-01-03 01:32:13
Regular Expressions
Stepan Voevodin, 2020-01-03 01:32:13

What is the regular expression for replacing text in places?

I want to automate my work on cleaning SVG, but I still couldn't figure out how to do it.

To do this:
<path d="M0 0h83.5v20H0z" fill="#fff"/>

It turned out like this:
<path fill="#fff" d="M0 0h83.5v20H0z"/>

In fact , d and fill need to be swapped.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
js-newbie, 2020-01-03
@melpnz

Search:
( d=".*?")( fill=".*?")
Replacement:
$2$1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question