MatchesAndTheirPositions()
Same as MatchesZ: This used to print @@(FindMatches()) and return nothing, which made the four aliases below -- every one of them named ...AndTheirPositions -- answer NULL while dumping to the console. Nothing carried a position at all.
Exemples de base (1)
oRx = new stzRegex("[0-9]+")
oRx.MatchXT("a12b345c6", 1, :MatchFirstOccurrenceIfNotGoPartial, [])
# Matches gives the values
? @@(oRx.Matches())
# MatchesZ gives value and position
? @@(oRx.MatchesZ())
# ...as DATA, not as console output
? isList(oRx.MatchesZ())
# ...one entry per match
? len(oRx.MatchesZ())
# ZZ gives the position as a SECTION instead
? @@(oRx.MatchesZZ())
# ValuesAndTheirPositions agrees
? @@(oRx.ValuesAndTheirPositions())
# ...and so does MatchesAndTheirPositions
? @@(oRx.MatchesAndTheirPositions())
# ...and it is not empty
? len(oRx.MatchingSubStringsAndTheirPositions())[ "12", "345", "6" ] [ [ "12", 2 ], [ "345", 5 ], [ "6", 9 ] ] 1 3 [ [ "12", [ 2, 4 ] ], [ "345", [ 5, 8 ] ], [ "6", [ 9, 10 ] ] ] [ [ "12", 2 ], [ "345", 5 ], [ "6", 9 ] ] [ [ "12", 2 ], [ "345", 5 ], [ "6", 9 ] ] 3
exécuté le 2026-10-02 04:23 dans la bibliothèque au commit 0e72e2e2c ; tiré de 00_regex_narrated.ring(s'ouvre dans un nouvel onglet)
Les extensions de cette méthode
Chaque extension, et si elle existe pour cette méthode ; une extension qui existe se compose avec les autres (FindSTCS).
Chaque exemple est un fichier de test de la bibliothèque, exécuté dans la bibliothèque pour cette page ; seuls ceux dont la sortie a tenu toutes les promesses écrites par leur fichier sont montrés. Les explications, les titres et le code sont ceux de la bibliothèque, en anglais.
Voir aussi
- La classe stzRegex
- La référence du domaine : Recherche de motifs
- Les autres méthodes de ces exemples : stzRegex.Match · stzRegex.Matches · stzRegex.MatchingSubStringsAndTheirPositions · stzRegex.ValuesAndTheirPositions

