More or less obvious is :
\[start\](.*?)\[end\]
but that yields the [start] and [end] tag too. How do you omit them?
E.g.: f("[somestartstring]result[someendstring]") == "result"
UPDATE: the suggested answers are not working. My code is:
printfn "%s" (Regex.Match(@"[start]result[end]",
"\\[start\\](.*?)\\[end\\]").Groups.[0].Value)
but it still yields the surrounding start and end tags.
My mistake is: the 0 index! Thank you.
You need to use a group, which is a match string within parantheses:
These are numbered from 1 when you come to read them (zero being the whole matched string). (There is also the facility of named groups if you find that more intuitive.)
E.g. in C#: