N. Drazenovic
N. Drazenovic

Reputation: 11

Regex - Find first whitespace after specific character

What is the regex expression to select only part of the string from a specific character to the first whitespace (space) i.e.:

in TEXT=331-6"-PR-003-BQ163*$WR01-6"-200-300-CL,STD* SAV=0.000000 SAB=0.000000

I would like to select only the part which is italicized (between *).

BR

Upvotes: 0

Views: 1014

Answers (2)

ALFA
ALFA

Reputation: 1744

If you mean $ as the starting specific character this:

(\$[^ ]*)\s

Test and explanation: https://regex101.com/r/AcSKA5/1

Upvotes: 0

Czarek
Czarek

Reputation: 669

\*[^ ]*

Explanation:

  • \* asterisk character, which is our specific character (it is special symbol, so \ is needed)
  • [^ ]* random number of characters different than space
  • space

Upvotes: 1

Related Questions