I’m a regexp newbie and I would like to know how to do a search and replace for the following case:
A file contains many occurrences of the following:
L1234_XL3.ext
and also many occurrences of:
L1234_XL3
I only want to find and replace L1234_XL3 occurrences with XL3 without affecting instances that have an extension.
I am using notepad++ to do the regular expression.
If Notepad++ supports lookaheads, you can simply use
L1234_XL3(?!\.ext)for the search and “XL3” for the replacement.EDIT: Looks like it doesn’t support lookaheads after all. A pity; you’ll have to do it the hard way without regexes (regexen?):