Can someone help me providing correct regex. I want to remove date from a string.
Ex string : IO_SE_SOURCE_2015-01-30T19_14_59 I want to remove the date part in the string and fetch only IO_SE_SOURCE as the result
I am doing this in python using re.sub() def.
So, when I do the below command
var=re.sub(regexpattern,repl,"POC_LN_SOURCE_2015-01-30T19_14_59.something")
var should contain the value POC_LN_SOURCE
-Thanks
_<datetime>?re.sub('([A-Z_]+)_([\d\-T_]+)(.+)','\\1', 'POC_LN_SOURCE_2015-01-30T19_14_59.something').POC_LN_SOURCE. Isn't that what you're getting?