Click here to Skip to main content
15,663,399 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?

+Reg Parham
Armando Baez
+Deems -lofi

+ -
Vittoria Siggillino

Kyd Kango 
Nils Jitner - Nils  -sjazz


+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.
Updated 27-Oct-22 23:17pm
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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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