RegEx omitting the round brackets
-
My RegEx is omitting the round brackets despite putting that in the Replace all/Replace in files field
I used this(<a name="\d+")(><b>)([^<]*)(?=</b></a></td>)in the find field and this$1 style="color: rgb(44, 121, 179); text-decoration: none;"$2<span style="line-height: 20px; font-family: Verdana,sans-serif; color: rgb(137, 155, 52); font-size: 13.5pt;">$3</span>in the Replace all/Replace in files field.
How do I get the brackets on replacing something that should have brackets? -
Parentheses (round brackets) carry meaning in the replacement, so you have to escape them:.
\(and\) -
This post is deleted! -
@PeterJones I added the
\just before the opening bracket as well as the closing bracket but it ain’t working. Please help! -
escaping parentheses works perfectly well in Notepad++ regular expressions.

and your regex, when modified to escape the parens, works perfectly well for me:

- FIND =
(<a name="\d+")(><b>)([^<]*)(?=</b></a></td>) - REPLACE =
$1 style="color: rgb\(44, 121, 179\); text-decoration: none;"$2<span style="line-height: 20px; font-family: Verdana,sans-serif; color: rgb\(137, 155, 52\); font-size: 13.5pt;">$3</span>
- FIND =
-
@PeterJones yea, it worked. I had a </p> in my next search - that’s why it di’n’t work before. Thanks a lot man!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login