| kind | = | "Regexp Match" |
contains behavior related to assignment
- [](index)
- afterMatch()
- asList()
- asText(...)
- beforeMatch()
- captures()
- end(index 0)
- length()
- match()
- namedOffsets()
- names()
- offset(index 0)
- offsets()
- pass()
- start(index 0)
- target()
Takes one indexing argument that should be either a number, a range, a text or a symbol. if it's a number or a range of numbers, these will specify the index of the capture to return. 0 is the whole match. negative indices are interpreted in the usual way. if the range is out of range it will only use as many groups as there are. if it's a text or a sym it will be interpreted as a the name of a named group to return. if an index isn't correct or wasn't matched, it returns nil in those places.
returns a list of all groups captured in this match. if a group is not matched it will be nil in the list. the actual match text is the first element in the list.
returns a list of all groups captured in this match. if a group is not matched it will be nil in the list. the actual match text is not included in this list.
Takes one optional argument that should be either a number or a symbol. this should be the name or index of a group to return the end index for. if no index is supplied, 0 is the default. if the group in question wasn't matched, returns -1.
returns a dictionary of all the names in this match. the keys will be symbols and the values either pairs of indices or nil
[ show source ]
method(
names inject({}, sum, name, sum +({}(name =>(offset(name)))))
)
Takes one optional argument that should be either a number or a symbol. this should be the name or index of a group to return the start and end index for. if no index is supplied, 0 is the default. if the group in question wasn't matched, returns nil, otherwise a pair of the start and end indices.
returns all the offsets for this match, including the full match. the result is a list of pairs, or nil for the groups that wasn't matched
[ show source ]
method( (0 ...(length)) map(n, offset(n)) )
will get the named group corresponding to the name of the message, or nil if the named group hasn't been matched. will signal a condition if no such group is defined.
Takes one optional argument that should be either a number or a symbol. this should be the name or index of a group to return the start index for. if no index is supplied, 0 is the default. if the group in question wasn't matched, returns -1.