1

I have the following text:

aa              
bb cc           
dd              
ee ff gg         

*Notice to the spaces:
enter image description here

I want to get match on every line until the last character that is not space.
This is what I want:

aa
bb cc
dd
ee ff gg

It looks like that:
enter image description here

I tried to follow:
Match until the next (and not the last) space after a specific pattern

And use:

.* [^ ]*

But it doesn't help.

E235
  • 11,560
  • 24
  • 91
  • 141

1 Answers1

1

I found how to do it:

.*([^\s]+)

Reference:
regular expression: match any word until first space

E235
  • 11,560
  • 24
  • 91
  • 141