| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.RE.CaptureID
- data CaptureID
- type CaptureNames = HashMap CaptureName CaptureOrdinal
- noCaptureNames :: CaptureNames
- newtype CaptureName = CaptureName {
- getCaptureName :: Text
- newtype CaptureOrdinal = CaptureOrdinal {}
- findCaptureID :: CaptureID -> CaptureNames -> Int
Documentation
CaptureID identifies captures, either by number (e.g., [cp|1|]) or name (e.g., [cp|foo|]).
Constructors
| IsCaptureOrdinal CaptureOrdinal | |
| IsCaptureName CaptureName |
type CaptureNames = HashMap CaptureName CaptureOrdinal Source
the dictionary for named captures stored in compiled regular expressions associates
noCaptureNames :: CaptureNames Source
an empty CaptureNames dictionary
newtype CaptureName Source
a CaptureName is just the text of the name
Constructors
| CaptureName | |
Fields
| |
Instances
| Eq CaptureName | |
| Ord CaptureName | |
| Show CaptureName | |
| Hashable CaptureName |
newtype CaptureOrdinal Source
a CaptureOrdinal is just the number of the capture, starting
with 0 for the whole of the text matched, then in leftmost,
outermost
Constructors
| CaptureOrdinal | |
Fields | |
findCaptureID :: CaptureID -> CaptureNames -> Int Source
look up a CaptureID in the CaptureNames dictionary