I am trying to make a Ultraedit regex which allows me to remove all words of a txt file containing a number.
For example:
test
test2
t2est
te2st
and...
get only test
I am trying to make a Ultraedit regex which allows me to remove all words of a txt file containing a number.
For example:
test
test2
t2est
te2st
and...
get only test
A case-insensitive search with Perl regular expression search string \<[a-z]+\d\w*\>
finds entire words containing at least 1 digit.
\<
... beginning of a word. \b
for any word boundary could be also used.
[a-z]+
... any letter 1 or more times. You can put additional characters into the square brackets like ÄÖÜäöüß also used in language of text file.
\d
... any digit, i.e. 0-9.
\w*
... any word character 0 or more times. Any word character means all word characters according to Unicode table which includes language dependent word characters, all digits and the underscore.
\>
... end of a word. \b
for any word boundary could be also used.
A case-insensitive search with UltraEdit regular expression search string [a-z]+[0-9][a-z0-9_]++
finds also entire words containing at least 1 digit if additionally the find option Match whole word is also checked.
[a-z]+
... any letter 1 or more times. You can put additional characters into the square brackets used in language of text file.
[0-9]
... any digit.
[a-z0-9_]++
... any letter, digit or underscore 0 or more times.
The UltraEdit regexp search string [a-z]+[0-9][a-z0-9_]++
in Unix/Perl syntax would be [a-z]+[0-9][a-z0-9_]*
which could be also used with find option Match whole word checked instead of the Perl regexp search.