Question

In CSV file I have couple thousands strings similar to that 20024la - (character number may vary but there is always white space before and after dash).

I need to remove all those strings including white spaces but leave everything that is after that.

Example string:

20023la - 100 lt storage cylinder RBA100 - 1120820

"20023la - " has to be removed from that example

Was it helpful?

Solution

You can try like this as well:

^(\b\d+[^\s-]+\s+-\s+)

It will match the first occurance, removing ^ will match ALL.

Demo

OTHER TIPS

Try using a pattern like:

\w+\s-\s(.*)

replace string:

$1

result:

100 lt storage cylinder RBA100 - 1120820

example:

http://regex101.com/r/lD5zE3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top