FsRegEx


Capturing

Capturing is a shortcut through matching to a named group or the group's captured value.

capture

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
open FsRegEx

let groupNumberRegExp = @"COD(?<GroupNumber>[0-9]{3})END"
let groupNumberName = "GroupNumber"

capture groupNumberRegExp groupNumberName "COD123END"
|> printfn "%s"

// 123

capture group

1: 
2: 
3: 
4: 
5: 
let group = captureGroup groupNumberRegExp groupNumberName "COD123END"

printfn "%s" group.Value

// 123
val groupNumberRegExp : string
val groupNumberName : string
val printfn : format:Printf.TextWriterFormat<'T> -> 'T
val group : obj
Fork me on GitHub