let IntAndString value =
let (|Match|_|) pattern input =
let m = Regex.Match(input, pattern) in
if m.Success then Some ([ for g in m.Groups -> g.Value ]) else None
match value with
| Match "(\d+)(\w+)" x -> x
| Match "(\w+)" x -> x
| Match "(\d+)" x -> x + "MY VALUE"
| _ -> List.Empty
how can I add a string to my string list here ?
(\w+)also matches digits, so your third case will never match. You should swap the second and third cases.