Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I want to cleanup the lines which consist of only symbols + - spaces. How can I do this?

FAUSTINE -fr
+Reg Parham
Armando Baez
+Zimmer90
++-
+Deems -lofi

+ -
Vittoria Siggillino

Kyd Kango 
Nils Jitner - Nils  -sjazz



to

FAUSTINE -fr
+Reg Parham
Armando Baez+Zimmer90
+Deems -lofi
Vittoria Siggillino
Kyd Kango 
Nils Jitner - Nils  -sjazz


What I have tried:

Solution 1 worked. It matches all thoselines.
Posted
Updated 27-Oct-22 23:17pm
v5
Comments
Mike Hankey 27-Oct-22 13:34pm    
Need to provide more information of what you're wanting to do.
RickZeeland 28-Oct-22 1:35am    
I see you added an example of what result is expected, can you also specify what programming language you are using?

1 solution

You can practice with an online tool like RegExr[^]

To match all spaces, + and - symbols try:
([ +-])+

To negate the result, try:
([^ +-])+

[Edit] To match lines, try:
([ +-]*\n)+
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900