Regex to match strings between quotes

I try to create a regular expression to match strings between quotes but it seem’s not working.

My RegExp:


Text to match:

[shortanalytics number=60 toptext="super test" bottomtext="test 2" icon=add]

>Solution :

You can try using the following one:



  • ": quote
  • ([^"]+): any character other than quote
  • ": quote

This will match any string between paired quotes, regardless of the content of the string between quotes.

In order to get your content, reference the first group of each match.

Try it here.

Leave a Reply