J
Joan Miller
I would to convert the first string to upper case. But this regular
expression is not matching the first string between quotes.
re.sub("'(?P<id>\w+)': [^{]", "\g<id>FOO", str)
# string to non-matching
'foo': {
# strings to matching
'bar': 'bar2'
'bar': None
'bar': 0
'bar': True
So, i.e., from the first string I would to get:
'BAR': 'bar2'
Any help? please
Thanks in advance
expression is not matching the first string between quotes.
re.sub("'(?P<id>\w+)': [^{]", "\g<id>FOO", str)
# string to non-matching
'foo': {
# strings to matching
'bar': 'bar2'
'bar': None
'bar': 0
'bar': True
So, i.e., from the first string I would to get:
'BAR': 'bar2'
Any help? please
Thanks in advance