S
S
Sergei E.2016-12-09 21:19:15
linux
Sergei E., 2016-12-09 21:19:15

Remove color:#000000 but not stop-color:#000000 with sed?

Greetings!
There is this line:

style="color:#000000;stop-color:#000000;solid-color:#000000;"

It must be removed from it color:#000000so as not to change the other two.
Only got to
sed -r 's/[^-]color:#([0-9a-zA-Z]{3}|[0-9a-zA-Z]{6});?//g'

but such an expression removes the preceding character ".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-12-09
@SmartFinn

I'll suggest as an option:

sed -r 's/([^-])color:#([0-9a-zA-Z]{3}|[0-9a-zA-Z]{6});?/\1/g'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question