Dave Papworth
Dave Papworth

Reputation: 313

Regex to extract a string value offset from the value searched for?

I'm struggling with regular expressions at present, and I have a specific problem I need to solve.

Where a named value after Chief Investigator exists (Here Mr A Smith), I want to extract Mr A Smith only. I know that in all cases, 'Mr A Smith' will be preceeded and followed by two astericks.

"**Chief Investigator:**Mr A Smith
**Sponsor**: xxxxxxxxxxx
**Study Team Contact**: xxxxxxxxx
**Grant deadline**: 
**Date EC meeting completed**: xxxxxxxxxx
**Upload Method**: xxxx

Any ideas gratefully recieved!

Upvotes: 0

Views: 185

Answers (1)

player0
player0

Reputation: 1

try:

=INDEX(TRIM(SPLIT(REGEXREPLACE(A1:A, ":\*\*|\*\*:", "♥"), "♥")),,2)

0

Upvotes: 2

Related Questions