-2

How can I grab only the value from the 'field' parameter between single or double quotes? String: {{code field='mail' type='news'}} or {{code field="mail" type='news'}}

I tried this pattern: (?:^|&)b=([^&]*)

But it doesn't stop at the second quotation mark and gives me 'mail' type='news' as a result, I need it to only return mail.

Izzy
  • 197
  • 3
  • 16

1 Answers1

1

I think field=['"](.+?)['"] is what you are looking for.

See it working on regex101.com.

JeffC
  • 22,180
  • 5
  • 32
  • 55