FSharpVerbalExpressions


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 FsVerbalExpressions.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
namespace FsVerbalExpressions
module FsRegEx

from FsVerbalExpressions
val groupNumberRegExp : string

Full name: Capture.groupNumberRegExp
val groupNumberName : string

Full name: Capture.groupNumberName
val capture : regularExpression:string -> groupName:string -> input:string -> string

Full name: FsVerbalExpressions.FsRegEx.capture
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
val group : FsVerbalExpressions.FsGroup

Full name: Capture.group
val captureGroup : regularExpression:string -> groupName:string -> input:string -> FsVerbalExpressions.FsGroup

Full name: FsVerbalExpressions.FsRegEx.captureGroup
property FsVerbalExpressions.FsGroup.Value: string
Fork me on GitHub