get the value inside the tag with RegEx in Python

I want to get the value inside the tag with RegEx in Python

The value I want to get from inside the tag:

"a","b","c"

this tag:

tagstring = 'tag("a","b","c")'

>Solution :

If you want without Regular expressions then try – string.find

tagstring = 'tag("a","b","c")'
mask = tagstring[tagstring.find("(")+1:tagstring.find(")")]
print(mask)

output #

"a","b","c"

Leave a Reply