On Mar 7, 4:32 am, Joan Miller wrote:
> I would to convert the first string to upper case. But this regular
> expression is not matching the first string between quotes.
>
Is using pyparsing overkill? Probably. But your time is valuable,
and pyparsing let's you knock this out in less time than i
Joan Miller wrote:
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\w+)': [^{]", "\gFOO", str)
Well, my first thought is that you're not using raw strings, so
you're not using the regexps and replace
Joan Miller wrote:
> 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\w+)': [^{]", "\gFOO", str)
>
> # string to non-matching
> 'foo': {
>
> # strings to matching
> 'bar': 'bar2'
> 'bar': None
> '
Hi Joan,
Joan Miller wrote:
> 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\w+)': [^{]", "\gFOO", str)
>
> # string to non-matching
> 'foo': {
>
> # strings to matching
> 'bar': 'bar2'
> 'ba