How to Replace a Matching Parenthetical up to the First Closing Parenthesis
-
(Foo,1234567890) (bar)
where the numerical string after Foo, can be any set of numbers, and where this sequence is repeated an indefinite quantity of times in a long list with or without including (bar) on each line.
Task: You must replace (Foo,1234567890) without replacing any instance of (bar).
The regular expressions on http://docs.notepad-plus-plus.org/index.php/Regular_Expressions are not functioning, or else poorly explained in human language.
-
Your request is kinda vague, at least to me, but let’s get the ball rolling:
Find:
\(\w+,\d+\)<----note the trailing space
Search mode: (obviously) Reg expProbably not what you want, but to me it works the way I understand the “spec” that has been presented.
-
I’m unable to edit the topic post for undisclosed reasons. The set of numbers after (Foo, can be in hexadecimal. I can’t possibly imagine what else you thought was “vague”.
-
Posts are only editable for 3 minutes.
With the new spec, I would try:
Find:
(?i)\(\w+,[0-9A-F]+\) -
Thank you very much for your assistance. This issue is now resolved.
-
@zetawilk, @alan-kilborn and All,
@zetawilk, in your initial post, you said :
Task: You must replace (Foo,1234567890) without replacing any instance of (bar)
You’re not asking, here, for any commercial demand. Personally, I would have written, preferably :
Request : replace (Foo,1234567890) without replacing any instance of (bar)
and thanked, in advance, possible repliers, for their [free] help !
Just remember it, in your next posts ;-))
Best regards,
guy038
P.S. :
I just forgot your last post. So, let me temper my criticism because you did thank Alan for his answers !
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