osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacing : with "${" at the beginning of the word and adding "}" at the end of the word


I have to execute the same sql in two different programs.
Each of them marks parameters differently.

Anyway, I have found the solution.

cnv_sel = re.sub(r"(:(.+?)\b)", r"${\2}", sel)


Reagards.