get the value inside the tag with RegEx in Python
Question:
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")'
Answers:
You can use this pattern "w","w","w"
:
import re
txt = 'tag("a","b","c")'
re.findall('"w","w","w"', txt)
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"
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")'
You can use this pattern "w","w","w"
:
import re
txt = 'tag("a","b","c")'
re.findall('"w","w","w"', txt)
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"