Remove all lines that contain characters other than
up vote
0
down vote
favorite
I have a list of with words and unwanted characters
hag-lawig
ha
waray
katapusan
/
¤
8¨2Þ‹%·/ój
An
ngatanan
nga
makakita
ha
akon
I want to remove all lines that contain characters other than a certain string of characters; in my case "a-z" and "-".
That is, in this case, lines containing "ó" "A" "%" etc. should be removed:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
Thank you for your help!
notepad++ regex
add a comment |
up vote
0
down vote
favorite
I have a list of with words and unwanted characters
hag-lawig
ha
waray
katapusan
/
¤
8¨2Þ‹%·/ój
An
ngatanan
nga
makakita
ha
akon
I want to remove all lines that contain characters other than a certain string of characters; in my case "a-z" and "-".
That is, in this case, lines containing "ó" "A" "%" etc. should be removed:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
Thank you for your help!
notepad++ regex
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a list of with words and unwanted characters
hag-lawig
ha
waray
katapusan
/
¤
8¨2Þ‹%·/ój
An
ngatanan
nga
makakita
ha
akon
I want to remove all lines that contain characters other than a certain string of characters; in my case "a-z" and "-".
That is, in this case, lines containing "ó" "A" "%" etc. should be removed:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
Thank you for your help!
notepad++ regex
I have a list of with words and unwanted characters
hag-lawig
ha
waray
katapusan
/
¤
8¨2Þ‹%·/ój
An
ngatanan
nga
makakita
ha
akon
I want to remove all lines that contain characters other than a certain string of characters; in my case "a-z" and "-".
That is, in this case, lines containing "ó" "A" "%" etc. should be removed:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
Thank you for your help!
notepad++ regex
notepad++ regex
asked Nov 29 at 6:54
Briis300
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
Ctrl+H
- Find what:
^.*[^a-z-].*$R?
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
^ # beginning of line
.* # 0 or more any character but newline
[^a-z-] # any character that is not lowercase or dash
.*
$ # end of line
R? # any kind of linebreak, optional
Result for given example:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Ctrl+H
- Find what:
^.*[^a-z-].*$R?
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
^ # beginning of line
.* # 0 or more any character but newline
[^a-z-] # any character that is not lowercase or dash
.*
$ # end of line
R? # any kind of linebreak, optional
Result for given example:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
add a comment |
up vote
2
down vote
Ctrl+H
- Find what:
^.*[^a-z-].*$R?
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
^ # beginning of line
.* # 0 or more any character but newline
[^a-z-] # any character that is not lowercase or dash
.*
$ # end of line
R? # any kind of linebreak, optional
Result for given example:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
add a comment |
up vote
2
down vote
up vote
2
down vote
Ctrl+H
- Find what:
^.*[^a-z-].*$R?
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
^ # beginning of line
.* # 0 or more any character but newline
[^a-z-] # any character that is not lowercase or dash
.*
$ # end of line
R? # any kind of linebreak, optional
Result for given example:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
Ctrl+H
- Find what:
^.*[^a-z-].*$R?
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
^ # beginning of line
.* # 0 or more any character but newline
[^a-z-] # any character that is not lowercase or dash
.*
$ # end of line
R? # any kind of linebreak, optional
Result for given example:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
answered Nov 29 at 13:15
Toto
3,37191126
3,37191126
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1379301%2fremove-all-lines-that-contain-characters-other-than%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown