Reputation: 98
I am trying to write the regex to search the string
String :
{@CSS resources=",resources/css/page.css,/resources/css/global.css ," /}
Regex:
{@CSS resources=\s*"(.*?)"\s*\/}|(^,)|(,$)
Need to find leading and trailing commas with "resources"
Upvotes: 1
Views: 56
Reputation: 29431
You can use this regex:
{@CSS resources=\s*"(\s*,\s*)*(.*?)(\s*,\s*)*"\s*\/}
and replace with {@CSS resources="$2" /}
Upvotes: 1