Created
July 7, 2014 08:50
-
-
Save DominicFinn/c1af0456268484873d1f to your computer and use it in GitHub Desktop.
Match exactly two numerical characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode 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