Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

複合パターン・マッチング

以下の複合パターンを使用すると、.ANP が受け入れた文字列を拒否する一方で、前の例 (O'Reilly-McMahon 3rd) のような姓を検証できます。 この例では、間接指定演算子@ と共にパターン・マッチを使用してパターンのコンポーネントを明確にしています。間接演算の説明は、このチュートリアルの対象ではありません。


SAMPLES>set lastname = ".1(1""O'"",1""Mc"")1U.L"

SAMPLES>set hyphenname = ".1(1""-"".1(1""O'"",1""Mc"")1U.L)"

SAMPLES>set title = ".1(1"" ""1(1""Sr"",1""Jr"",1""3rd"",1""4th""))"

SAMPLES>set complete = lastname _ hyphenname _ title

SAMPLES>if last1?@complete {write "valid"}
valid
SAMPLES>if last2?@complete {write "valid"}

SAMPLES>

FeedbackOpens in a new tab