How to remove dashes only from the line in RegExp?

How to remove dashes only from the line in RegExp? HKCU\Profiles\0\lines to modify " -a -b -c" ex. HKCU\Profiles\0\lines to modify " -a -b -c" HKCU\Profiles\0\line line unchanged " -a -b -c" it should be HKCU\Profiles\0\lines to modify " a b c" HKCU\Profiles\0\line line unchanged " -a -b -c"

Mar 19, 2025 - 15:36
 0
How to remove dashes only from the line in RegExp?

How to remove dashes only from the line in RegExp?

HKCU\Profiles\0\lines to modify " -a -b -c"

ex.

HKCU\Profiles\0\lines to modify " -a -b -c"
HKCU\Profiles\0\line line unchanged " -a -b -c"

it should be

HKCU\Profiles\0\lines to modify " a b c"
HKCU\Profiles\0\line line unchanged " -a -b -c"