Show all details
You can access named patterns and nested named patterns by dot-indexing into a pattern. For
example, you can access the nested named pattern subdomain by dot-indexing from emailPattern
into domain and then dot-indexing again into subdomain.
emailPattern.domain.subdomain
ans = pattern
Matching:
asManyOfPattern(identifier + ".") + identifier
Show all details
Dot-assignment can be used to change named patterns without needing to rewrite the rest of the
pattern expression.
emailPattern.domain = "mathworks.com"
emailPattern = pattern
Matching:
local_part + "@" + domain
Using named patterns:
local_part: asManyOfPattern(identifier + ".") + identifier
domain
: "mathworks.com"
Show all details
See Also
pattern | string | regexp | contains | replace | extract
More About
•
“Search and Replace Text” on page 6-37
•
“Regular Expressions” on page 2-51
6 Characters and Strings
6-44
Précédent

- 226/1450

Suivant