vb.net - RegEx to match tokens and keep delimiter -
I want to match all the tokens of these strokes and the delimiter (to keep separate capturing groups) this RegEx (vb .net):
Output: As the escape addimeter I The result of Thank you for your help Try it out: < Pre> It will not necessarily be Explanation: ([^ ~ \ + \:] *) ([~ \ + \:])
Text1 + Text2 :: Text4 :: Text6 ~ Text1 + Text2: Text3 + text4 ~
? How can I get it with (strange number of
? )?
Text1 + Text2 ?: Text3 ~
Text1 + Text2 ?: Text3 ~
((?: \?. | | | [^ ~ +:]) *) ([~ +:])
? A in
a or
?? Avoid
in , then you will need to post something - even without processing, a
? will effectively escape the next character if:
?: will not be a delimiter,
??: will be a delimiter,
???: < / Code> there will be no limit. / P>
(Capture group for text # is started) (?: (? # Non-capture for repeat changes Start the group) \? (? # Match? Is actually being followed by any character - to avoid) | (? # OR) [^ ~ +:] (? # No non-delimiter characters found ~, +, And :)) * (? # Repeat non-capture group (0 # time)) (? Capture Capture group) (Captive group starts for # delimiter?) [~ +:] (? # Matches any delimiter character ~, +, Su :)) (? # Capture Capture)
Comments
Post a Comment