3

I have string. It can be in the following format

Folkestone Result

Ascot (IRE) Result

Folkestone Last (IRE) Result

Winterfall Win Result

Help create a regular expression to search for words in bold!

(.*)(?=\()|Result

My version is not quite working correctly

1 Answers1

2

I have solution!

/^(.*?)(?=\(|Result)/m

Alternation inside the lookahead. Use in multiline-mode: m modifier

test at regex101, regex faq

Community
  • 1
  • 1
Jonny 5
  • 11,051
  • 2
  • 20
  • 42