Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

pattern

Annotations

alternation

Introduced in the 1995 ANSI M[UMPS] language standard.

This metalanguage symbol represents a specification of multiple alternate patterns that may occur to satisfy part of a pattern match specification.

A list of alternate patterns looks like a list of pattern atoms (separated by commas) enclosed in parentheses.

Modification in a future M[UMPS] language standard.

A list of alternate patterns looks like a list of pattern specifications (separated by commas) enclosed in parentheses.

Note: The limitation to pattern atoms in the 1995 ANSI M[UMPS] language standard was unintended.

charspec

Approved for inclusion in a future M[UMPS] language standard.

This metalanguage symbol represents a "pattern range". A pattern range is indicated by a specification enclosed in square brackets. Such a specification looks like either a single constant, or two constants separated by a colon. A strconst (string-constant), in this context, is either a string literal, or a reference to the intrinsic function $Char.

patatom

Introduced in the 1977 ANSI M[UMPS] language standard.

This metalanguage symbol represents one part of a pattern to be matched. A specification consists of either a number (intlit) or a period followed by either a string literal or a pattern code (patcode).

Valid specifications are:

1"string"
9"THIS SPECIFIC TEXT"
3E
.A
5N

Addition in the 1984 ANSI M[UMPS] language standard.

Ranges of occurrences are introduced.

Valid specifications are:

1.5N
2.7"This String"
.3A
6.N

Additions in a future M[UMPS] language standard.

Alternative options for one pattern atom are introduced (see metalanguage symbol alternation.

Valid specifications look like:

1.5(2A,3N,1"Xyz")

A pattern-match operation may also be used to extract the value of the sub-string that matches a specific pattern and store the value of this sub-string into a variable. In this context, a pattern atom may end with a name of a variable, enclosed in parentheses, e.g. If X?4N(ITEM)3A.

patcode

Introduced in the 1977 ANSI M[UMPS] language standard.

This metalanguage symbol represents a code that identifies a certain class of characters. Valid codes are A, C, E, L, N, P and U.

Addition in the 1995 ANSI M[UMPS] language standard.

Implementors and applications can define their own pattern codes by supplying a pattern-check algorithm in the structured system variable ^$Character(charset,"PATTERN",newcode).

Additions in a future M[UMPS] language standard.

Patterns may also be "negated", i.e. a string that matches a negated pattern matches anything but the pattern that is being negated.

A pattern code may also be a "pattern range". A pattern range is indicated by a charspec specification enclosed in square brackets. Such a specification looks like either a single constant, or two constants separated by a colon. A strconst (string-constant), in this context, is either a string literal, or a reference to the intrinsic function $Char.

patgrp

Approved for inclusion in a future M[UMPS] language standard.

This metalanguage symbol represents a group of patatoms (pattern-atoms).

Such a group may occur in the context of an alternation, which is a specification of a number of patterns, one of which should be matched by the string that is being compared to this list of possible patterns.

patnonY

Introduced in the 1995 ANSI M[UMPS] language standard.

This metalanguage symbol represents any character that is valid in an identifier (see the metalanguage symbol ident) and that is not the character Y ($Char(89) or "Y").

patnonYZ

Introduced in the 1995 ANSI M[UMPS] language standard.

This metalanguage symbol represents any character that is valid in an identifier (see the metalanguage symbol ident) and that is not one of the the character Y ($Char(89) or "Y") or Z ($Char(90) or "Z").

patnonZ

Introduced in the 1995 ANSI M[UMPS] language standard.

This metalanguage symbol represents any character that is valid in an identifier (see the metalanguage symbol ident) and that is not the character Z ($Char(90) or "Z").

patsetdest

Approved for inclusion in a future M[UMPS] language standard.

This metalanguage symbol represents the destination where the value of a sub-string may be stored. Such a destination looks like the name of a variable, enclosed in parentheses.

A pattern-match operation may be used to extract the value of the sub-string that matches a specific pattern and store the value of this sub-string into a variable. In this context, a pattern atom may end with a name of a variable, enclosed in parentheses, e.g. If X?4N(ITEM)3A.

patstr

Approved for inclusion in a future M[UMPS] language standard.

This metalanguage symbol represents either a string literal or a "negated" string literal. This metalanguage symbol was added to facilitate the definition of "negated pattern matching".

A string literal is "negated" when it is preceded by the unary operator "not" (apostrophe).

pattern

Introduced in the 1977 ANSI M[UMPS] language standard.

This metalanguage symbol represents the specification of a text pattern. A pattern specification is either an indefinite repetition of pattern atoms (see the metalanguage symbol patatom), or an indirection operator followed by an expression that evaluates to a pattern specification.

repcount

Introduced in the 1984 ANSI M[UMPS] language standard.

This metalanguage symbol represents the number of times that a certain pattern element may occur in the total pattern.

Examples:

12 exactly 12
. any number
5. at least 5
.9 at most 9

strconst

Approved for inclusion in a future M[UMPS] language standard.

This metalanguage symbol represents a string constant. A string constant appears in the context of "pattern ranges", and looks like either a string literal, or a reference to the intrinsic function $Char.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 15-Nov-2023, 13:19:37.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)