正则表达式:查找字母结束和数字开始的位置

时间:2015-09-21 15:24:42

标签: php regex

我有import pandas as pd import numpy as np df = pd.read_csv("Data_set.csv", sep='\s*', names=["month", "day", "time", "Temperature"]) group=df.groupby(["month","day"]) daily=group.aggregate({"Temperature":np.mean}) daily.to_csv('daily.csv') Date Time T1 T2 T3 17/12/2013 00:28:38 19 23.1 7.3 17/12/2013 00:58:38 19 22.9 7.3 17/12/2013 01:28:38 18.9 22.8 6.3 17/12/2013 01:58:38 18.9 23.1 6.3 17/12/2013 02:28:38 18.8 23 6.3 ..... ..... 24/12/2013 19:58:21 14.7 15.5 7 24/12/2013 20:28:21 14.7 15.5 7 24/12/2013 20:58:21 14.7 15.5 7 24/12/2013 21:28:21 14.7 15.6 6 24/12/2013 21:58:21 14.7 15.5 6 24/12/2013 22:28:21 14.7 15.5 5 24/12/2013 22:58:21 14.7 15.5 4 MA14等字符串,我必须找到MD22bMA之间的索引。

1 个答案:

答案 0 :(得分:2)

尝试:

(?<=[A-Z])(?=\d)|(?<=\d)(?=[A-Z])

DEMO

ind demo添加了用于组捕获的(),以显示与其匹配的索引。