TWO RESULTS IN A SAME LINE
-
I imagine it to be very simple … But I’m new with Notepad ++, I found a difficulty in generating the ER of this situation:
line 1: | abc | test | def |
line 2: | abc | nop | bbb |
line 3: | abc | def | aaa |I need the results that have | abc | and | def | on the same line, so you can replace the o | def | for | def1 | only in those initiated by | abc |.
Thank you! -
Can’t figure out what you want to replace exactly (from the description) but based on the title and general idea I 'll give an example that you might modify to achieve your real goal:
I want to find lines starting with abc and change MISTeak later in the line to CORRECTED without changing anything else, using Replace dialog with Regular expresions:
Find: ^(abc.*)MISTeak
Replace: $1CORRECTED
^ start of line match only
( ) parens “capture” whatever is between them, you must write ( or ) if you need to match a real paren
abc – match literally abc
.* any characters, as many as are found including NONE.
MISteak : those literal characters (can be marked case sensitive or not)$1 replace what you found in FIRST paren set, if you had () and () the $2 would be 2nd capture etc.
Save your doc, try it, use undo if you make a mistake and if you seriously foul it up reload the saved doc from disk.
Weakness (which can be fixed): What if MISTeak appears more than once in the line – there are ways to fix that too.
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