Get a text beside a qoute using regex -


this text

"this quote"

the output must be

"this quote"

so getting word beside qoute

so far regex code

"\s*(.*?)\s*" 

but getting string inside quote

you can use regex match word next or before double quote:

"\s*\s+|\s+\s*" 

regex demo

your regex "\s*(.*?)\s*" match text between quotes , optional whitespaces.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -