Press CTRL+C or CMD+C to copy the selected text and close this dialog.
4 people like it.
Like the snippet!
Regex String and Int, e g : "qwe123" -> "qwe" and 123, "qwe" -> "qwe", 123 -> 123
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 -> Some(x)
| Match @"((?>\d+))" x -> Some(x @ ["items"])
| Match @"(\w+)" x -> Some(x)
| _ -> None
This web site is created using F# and Suave web server. It is hosted on
Azure and the source code is on GitHub. Contributions
The first version of fssnip.net has been created by
@tomaspetricek back in 2010.
This web site is a new, open-source and contribution-friendly version.