Browse Source

Added match text function.

WRote test scripts.
master
Craig Oates 6 years ago
parent
commit
bcf91c67f2
  1. 4
      WetPancake/DataProcessing.fs
  2. 4
      WetPancake/Script.fsx

4
WetPancake/DataProcessing.fs

@ -1,3 +1,7 @@
module internal DataProcessing
open System.Text.RegularExpressions
let MatchText pattern text = Regex.IsMatch(text, pattern)
let JoinWords words = String.concat " " words

4
WetPancake/Script.fsx

@ -44,6 +44,10 @@ let dc_replace5 =
let dc_split = SplitText @"\s+" "This is a test string."
// Data Processing
let dp_isStart = MatchText @"^[A-Z]" "This is a test"
let dp_isEnd = MatchText @"\." "and the end is nigh."
let dp_failStart = MatchText @"^[A-Z]" "somewhere in the middle"
let dp_failEnd = MatchText @"\." "this is not the end"
let dp_words =
let words = ["This"; "is"; "a"; "test"; "."]
JoinWords words
Loading…
Cancel
Save