file_name_to_preprocessing_method("heloc_dataset_v1(exc empty rows.).csv_pre(-1,asis).csv")
should return the string "(-1,asis)", possibly using .find()
.
Using re.findall
for a regex approach:
inp = "file_name_to_preprocessing_method(\"heloc_dataset_v1(exc empty rows.).csv_pre(-1,asis).csv\")"
matches = re.findall(r'\bcsv_pre(\(.*?\))', inp)
print(matches[0]) # (-1,asis)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.