Skip to content

Instantly share code, notes, and snippets.

@DominicFinn
Created July 7, 2014 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominicFinn/c1af0456268484873d1f to your computer and use it in GitHub Desktop.
Save DominicFinn/c1af0456268484873d1f to your computer and use it in GitHub Desktop.
Match exactly two numerical characters
open System
open System.Text.RegularExpressions
let matcher(s) =
let regex = new Regex("^[0-9]{2}$")
let matched = regex.Match(s)
matched.Success
let stringOne = matcher "dom" // false
let stringTwo = matcher "12" // true
let stringThree = matcher "1534" // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment