How to keep parenthesis in Notepad++ regex find/replace

10,354

Use LIGHTING-W/AREA = \( 1.2 \) in your replace box

Share:
10,354
Anthony
Author by

Anthony

Updated on June 15, 2022

Comments

  • Anthony
    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
    Anthony about 10 years
    Perfect! Now why did that work? I'm guessing parenthesis are special characters that have to be treated differently in searches?
  • Sico
    Sico about 10 years
    exactly, the backslashes 'escape' the parenthesis making regex treat it as text to look for.