How to keep parenthesis in Notepad++ regex find/replace
10,354
Use LIGHTING-W/AREA = \( 1.2 \) in your replace box
Author by
Anthony
Updated on June 15, 2022Comments
-
Anthony almost 2 years
I'm trying to convert
LIGHTING-W/AREA = ( 1.7549 )
To
LIGHTING-W/AREA = ( 1.2 )
Using the notepad++ regex find/replace tool
When I use
LIGHTING-W/AREA = (.*) and replace with LIGHTING-W/AREA = ( 1.2 )
I get LIGHTING-W/AREA = 1.2 instead of LIGHTING-W/AREA = ( 1.2 )
What happened to my paranthesis and how do I get them back? Sorry, not a programmer by trade!
-
Anthony about 10 yearsPerfect! Now why did that work? I'm guessing parenthesis are special characters that have to be treated differently in searches?
-
Sico about 10 yearsexactly, the backslashes 'escape' the parenthesis making regex treat it as text to look for.