I have a string which is txt = "$2024122201200}"
or txt = "$2024122201200"
, and I want to get the string 2024122201200
, I tried as below
import re
x = re.findall("$(.*)(?=}{0,1})", txt)
print(x)
but always come as ['2024122201200}']
, actually I want ['2024122201200']
, as my understanding, it should be working.
maybe I confused everyone, firstly, here the sample is all digit, but actually it’s digit/Character all possible. secondly, if not use re, which should use? I checked all need regex even use string.
one more clarify for this question, actually I tried to replace the parameter which define in config xml, like ${currenttime} or ${currentbalance-300}, but boss said sometime this parameter should be $currenttime or $durrentbalance -300, so I need write regex to match it
9