VSFlexString Control > VSFlexString Properties, Events, and Methods > VSFlexString Properties > TagCount Property |
Returns the number of tags found after setting the Pattern, Text, or MatchIndex properties.
val& = [form!]VSFlexString.TagCount
Tags are parts of the search pattern delimited with curly braces ("{}"). Using tags allow you to refer to parts of each match. The TagCount value is normally used as an upper bound in loops that enumerate the tags for a specific match. Information about each specific tag can be retrieved using the TagString, TagStart, and TagLength properties.
For example:
fs.Text = "Mary had a little lamb"
fs.Pattern = "Mary had {.*}"
Debug.Print fs.TagCount; "tag: [" & fs.TagString(0) & "]"
This code produces the following output:
1 tag: [a little lamb]
For a more detailed example, see the TagString property.
Long