DEV Community

Piotr Przeklasa
Piotr Przeklasa

Posted on

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"

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

DEV shines when you're signed in, unlocking a customized experience with features like dark mode!

Okay