Reputation: 157
I have a N++ file with the following lines:
asm-java-2.0.0-lib
cib-slides-3.1.0
lib-hibernate-common-4.0.0-beta
I want to remove everything from the '-' before the numbers begin so the results look like:
asm-java
cib-slides
lib-hibernate-common
So far I've come up with [0-9]+
but that ignores the '.'
and the trailing alphabets. Does anyone know a correct command for find and replace?
Upvotes: 0
Views: 177
Reputation: 91385
-\d.*$
LEAVE EMPTY
. matches newline
Explanation:
- # a dash
\d # a digit
.* # 0 or more any character but newline
$ # end of line
Result for given example:
asm-java
cib-slides
lib-hibernate-common
Upvotes: 2
Reputation: 15545
Here's regex I used in VSCode
to find and replace to get your task done:
(.*)?-\d.*
And replace with $1
Not sure about notepad++ but should get it done for you as well.
Upvotes: 1