MatchInfo.fetchNamedPos

Retrieves the position in bytes of the capturing parentheses named name. If name is a valid sub pattern name but it didn't match anything (e.g. sub pattern "X", matching "b" against "(?P<X>a)?b") then start_pos and end_pos are set to -1 and TRUE is returned. Since 2.14

class MatchInfo
int
fetchNamedPos
(
string name
,
out int startPos
,
out int endPos
)

Parameters

name string

name of the subexpression

startPos int

pointer to location where to store the start position, or NULL. out[allow-none]

endPos int

pointer to location where to store the end position, or NULL. out[allow-none]

Return Value

Type: int

TRUE if the position was fetched, FALSE otherwise. If the position cannot be fetched, start_pos and end_pos are left unchanged.

Meta