The regular expression u+ matches any sequence of one or more u 's. The first of these, u, matches a single occurrence of the letter ' u '. Since single alphabetic characters all constitute atoms, each of u, u+, u*, and u? are examples of pieces based on the atomic regular expression u consisting of the single character ` u '. Ī string matches a piece of the form a?, where a is an atom, if it matches zero or one occurrences of a. Ī string matches a piece of the form a+, where a is an atom, if it matches one or more consecutive occurrences of a. The purpose of these characters is as follows:Ī string matches a piece of the form a*, where a is an atom, if it matches zero or more consecutive occurrences of a. (Their decomposition into single characters is merely a technical convenience.)Ī piece consists of an atom, optionally followed by one of the characters `*', `+' or `?'. Matches the regular expression Maple, because it contains a match ( M ) for the first piece, followed immediately by a match for the second piece ( a ), and so on.Īlthough simple regular expressions like Maple decompose further, in practice, one normally thinks of these as "morally atomic", because they always match in this simple, straight-forward way. The fastest computer algebra system is Maple, of course! A string matches a regular expression if it contains a match for the first piece, followed (immediately) by a match for the second piece, followed (immediately) by a match for the third piece, and so on.įor instance, each literal string that doesn't contain special characters, such as " Maple ", can be understood as a concatenation of the pieces M, a, p, l, and e. Matches any (single) lowercase character of the English alphabet.Įach branch of a regular expression is composed of pieces, which are composed by juxtaposition. ![]() A regular expression matches any string that matches any one among its branches.Ī|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z Regular expressions consist of one or more branches, separated from one another by the character ` | '. For example, the string abc is a regular expression matching any string that contains exactly the text abc as a substring. Note: In the examples that follow, assume that any literal string consisting exclusively of alphanumeric characters is a regular expression that matches itself. ![]() Regular expression support in StringTools is based on the POSIX 1003.2 standard for extended modern regular expressions. This document explains the regular expression syntax accepted by the Maple StringTools package.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |