Matching a complex expression in python regex -


i have create unique textual marker in document using python 2.7, following function:

def build_textual_marker(number, id):     return "[xxxcixxx[[_'" + str(number) + "'] [_'" + id + "']]xxxcixxx]" 

the output looks : [xxxcixxx[[_'1'] [_'24']]xxxcixxx]

and have catch occurrence of expression in document. ended following regular expression seems not working fine:

marker_regex = "\[xxxcixxx\[(\[_*?\])\s(\[_*?\])\]xxxcixxx\]" 

i wondering how should write correct regex in case?

try using

\[xxxcixxx\[\[_'.*?'\] \[_'.*?'\]\]xxxcixxx\] 

demo: http://regexr.com/3d887


Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Ansible - ERROR! the field 'hosts' is required but was not set -

Copy range with conditional formatting -