0

I am having trouble with some replacement with regular expression in Python. I would like to replace "sqrt(abc))/" with "(abc)/`"

Below is my attempt:

str_test = "sqrt(abc))/"
re.sub("^sqrt\(.*\)","(.*)",str_test)

I get literal expression "." out. How can I replicate whatever is captured by "."?

user191919
  • 704
  • 8
  • 26

0 Answers0