从数组元素中删除文本

时间:2019-06-04 03:18:09

标签: javascript

很抱歉,如果这是一个菜鸟问题。我想减少数组元素的值。

我指定了此数组以获取值-> May 20 2019 00:00:00 GMT+0800 (Philippine Standard Time)并返回this.helper.workingExperienceList[0]["start_date"].replace(/00:00:00 GMT+0800 (Philippine Standard Time)/g, "")

我尝试使用此May 20 2019,但有一个不是函数的错误。

预期输出应为import re s = "Too many people, but not All Awesome Dudes (AAD) only care about the Initiative on Methods, Measurement, and Pain Assessment in Clinical Trials (IMMPACT)." allabbre = [] for match in re.finditer(r"\((.*?)\)", s): start_index = match.start() abbr = match.group(1) size = len(abbr) words = s[:start_index].split() count=0 for k,i in enumerate(words[::-1]): if i[0].isupper():count+=1 if count==size:break words=words[-k-1:] definition = " ".join(words) abbr_keywords = definition + " " + "(" + abbr + ")" pattern='[A-Z]' if re.search(pattern, abbr): if abbr_keywords not in allabbre: allabbre.append(abbr_keywords) print(abbr_keywords)

请帮助!

0 个答案:

没有答案