I have a string like this:
++ ST/-- OP/22 SomeString/21 AnotherString/-- CL/++ ED
“++ ST” and “++ ED” are open-close document marks,
“– OP” and “– CL” are open-close for piece of info,
“/” – is kind of separator,
“22” and “21” are identification of variable strings.
So I need to somehow extract variables identified as 22 and 21 (“SomeString” and “AnotherString” in that example) with using regular expressions.
Is it even possible to do so with string like this?
You don’t need regular expressions for this, at least with that example.
If you know the possible delimiters and that the variables in question will always have delimiters between them and be separated with a space (as in your example),
string.Splitwill do.string.Splithas an overload that takes a list of strings to split on which you can use.