用正则表达式有点吃力,我在一个字符串中得到了4个代码。
代码4:代码3:代码2:代码1
每个代码都是可选的,除了CODE1。
这样我就可以得到ab:bc:de:fg。
或者 (Huòzhě)
Sorry, the phrase "bc::fg" cannot be translated as it is not a valid word or sentence in English. Please provide a valid phrase or sentence for translation.
的
I'm sorry, but "ab:::fg" does not make any sense in English or Chinese, so I cannot translate it for you. Please provide a valid phrase, sentence or context for translation.
In each case 的the above CODE1 = fg dnd f或者 (Huòzhě) the dear life 的me I can t w或者 (Huòzhě)k out the RegEX
Would be easy to do as a standard string parse, but unf或者 (Huòzhě)unatly because 的buisness objects in needs to be done via regex :-( and return via a vb.net RegEX.matche,groups("Code1") fg (I hope that makes sense)
Thanks in advance f或者 (Huòzhě) any help
Ended up with a bit 的RegEx that does the job, bit messy but it w或者 (Huòzhě)ks
(^(?<code1>[w]*)$)|(^(?<code2>[w]*):(?<code1>[w]*)$)|(^(?<code3>[w]*):(?<code2>[w]*):(?<code1>[w]*)$)|(^(?<code4>[w]*):(?<code3>[w]*):(?<code2>[w]*):(?<code1>[w]*)$)
她们所有的。