Home > OS >  How to select all words that begin with a * but don't end in a *
How to select all words that begin with a * but don't end in a *

Time:05-03

What I need to select:

*Hello
*hey!!!

What I don't need to select:

*Hello*
*hey!!!*

CodePudding user response:

This pattern finds the words that you want.

\*[^\s\*] (?=(\s|$))

see https://regex101.com/r/0sYbIH/1

  • Related