我是正则表达式的新手,我觉得这很难解决:
我有以下字符串:
"inforun 7970 12423 99 10:03 ? 00:09:03 abcd -PR -gmh domain.den.abc.com -gmp 6020 -guid 9c06cc02-b1c8-41cf-93e6-1d795e9fff62 -rst 180 -s FOLDER_NAME:wkf_workflow.s_session -something Session task instance [session]"
我必须提取timewhich10:03和'domain'indomain.den.abc.com和 the FOLDER_NAME, the 'workflow'in the'wkf_worklfow'和 the 'session'in the 's_session', time, domain,foldername并workflow为session每个字符串不断变化,并且有一堆像这样的字符串都作为单个字符串连接。以下是每个字符串共有的模式。the'abcd -PR -gmh'是常见的,可以帮助找到在 the 之前的时间'?'
对于'-s', ':wkf'所有字符串都是常见的,而 thefolder_name正好在这两者之间。'workflow'介于两者之间,'wkf_'会话'.s_'
介于两者之间's_',紧接下一个'-'
我需要单独的字符串中的时间、域、文件夹名称、工作流和会话。几天前我才尝试练习正则表达式,我什至要花很多时间才能理解这里"\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z"给出的东西
谢谢你的帮助