Reputation: 1725
I would like to remove all words behind the number.
12 - Balloon Cool
1 - I would like to sleep
541 - Sleep is for weak/sheep
Currently I 'm using this regex to replace them with empty
/ - (\w+( +\w+)*)/
It managed to filter some but not for the string with slash.
12
1
541sheep
Upvotes: 1
Views: 190
Reputation: 784948
To remove any thing after space-hyphen-space you can just use:
/ - .*$/m
Upvotes: 2
Reputation: 1403
I would use something like this:
Search: ^(\d+)\s+-.*?
Replace: $1
Upvotes: 0