import re
def pythonReSubDemo(inputStr):
"""
demo Pyton re.sub
"""
# inputStr = "recordInvalidDate"
def to_lower(matched):
s = matched.group(0).lower()
t = f'_{s}'
return t
replacedStr = re.sub(r"([A-Z])", to_lower, inputStr)
print("replacedStr=", replacedStr) # record_invalid_date
if name == "main":
s1 = """
organizationName,parkCode,parkAddress, parkNature, parkRegionId1, parkRegionId2,'
' parkType,parkClass, parkLon, parkLac, spaceLoc, isShared, sharedParkPlaceNum, parkStage,'
' stageDate,berths, openParkPlaceNum, chargeNum, entranceNum, exitNum, licence, sentDateTime,'
' recordEffectDate,recordInvalidDate, tsaaFee, tbaaFee, daySmallCarChrononMinsFirstHour,'
'chargingStandardTempSmallCarDayFirstHour
"""
s2 = s1.split(',')
for i in s2:
pythonReSubDemo(i)