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

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

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -