-2

This is related to: RegEx: Grabbing values between quotation marks.

If there is a String like this:

HYPERLINK "hyperlink_funda.docx" \l "FunHere" \o "text" \t "_parent"

What regex could return the value enclosed in quotation mark only for switch \l?

FunHere
Community
  • 1
  • 1
unknown_boundaries
  • 1,482
  • 3
  • 25
  • 47

2 Answers2

3

Assuming there's no escaped " or lines in // comments that should be accounted for:

\\l\s*"([^"]*)

Regular expression visualization

Debuggex Demo Your match will be in group 1.

asontu
  • 4,548
  • 1
  • 21
  • 29
1

The following regex will capture the required words in the 1st capture group:

\\l\s*"(\w+)"

hehe
  • 101
  • 1
  • 2