In the following example, using Python 3.8, I am looking to replace only the comma in NUMBER(38,0) with a pipe.
MISC1 VARCHAR, MISC2 VARCHAR, NUMBERS NUMBER(38,0), MISC3 VARCHAR
The expected outcome would be
MISC1 VARCHAR, MISC2 VARCHAR, NUMBERS NUMBER(38|0), MISC3 VARCHAR
The NUMBER(38,0) could appear anywhere in the list so I cannot specify the 3rd comma, for example, and NUMBER(38,0) could appear several times. In addition, I need to be able to do this even if the numeric values inside the brackets changes such as NUMBER(24,2).
I have not been able to come up with a working solution that does not replace all the other commas as well so I am reaching out to the expert in the hive to see if someone else more knowledgeable then me can figure this out.
The RE string I have been using is
([A-Z])\w+\([0-9]+,[0-9]+\)
Thank you for taking a look.
NUMBER(xx,x)... it seems to me you need to search forNUMBER(and then find the next)after that and replace the comma inside of those indexes. In the long run, that's probably an easier to maintain solution than a regex here.