Changeset 13049 in project
- Timestamp:
- 01/21/09 02:46:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/Unit regex
r13009 r13049 72 72 characters, respectively. 73 73 74 75 === regexp*76 77 [procedure] (regexp* STRING [OPTIONS [TABLES]])78 79 Returns a precompiled regular expression object for {{string}}. The optional80 argument {{OPTIONS}} must be a list of option symbols. The optional argument81 {{TABLES}} must be a character definitions table (not defined here).82 83 84 Option Symbols:85 86 ; caseless : Character case insensitive match87 ; multiline : Equivalent to Perl's /m option88 ; dotall : Equivalent to Perl's /s option89 ; extended : Ignore whitespace90 ; anchored : Anchor pattern match91 ; dollar-endonly : `$' metacharacter in the pattern matches only at the end of the subject string92 ; extra : Currently of very little use93 ; notbol : First character of the string is not the beginning of a line94 ; noteol : End of the string is not the end of a line95 ; ungreedy : Inverts the "greediness" of the quantifiers so that they are not greedy by default96 ; notempty : The empty string is not considered to be a valid match97 ; utf8 : UTF-8 encoded characters98 ; no-auto-capture : Disables the use of numbered capturing parentheses99 ; no-utf8-check : Skip valid UTF-8 sequence check100 ; auto-callout : Automatically inserts callout items (not defined here)101 ; partial : Partial match ok102 ; firstline : An unanchored pattern is required to match before or at the first newline103 ; dupnames : Names used to identify capturing subpatterns need not be unique104 ; newline-cr : Newline definition is `\r'105 ; newline-lf : Newline definition is `\n'106 ; newline-crlf : Newline definition is `\r\n'107 ; newline-anycrlf : Newline definition is any of `\r', `\n', or `\r\n'108 ; newline-any : Newline definition is any Unicode newline sequence109 ; bsr-anycrlf : `\R' escape sequence matches only CR, LF, or CRLF110 ; bsr-unicode : `\R' escape sequence matches only Unicode newline sequence111 112 ; dfa-shortest : Currently unused113 ; dfa-restart : Currently unused114 115 116 74 === regexp? 117 75 … … 124 82 === string-match-positions 125 83 126 [procedure] (string-match REGEXP STRING [START])127 [procedure] (string-match-positions REGEXP STRING [START])84 [procedure] (string-match REGEXP STRING ) 85 [procedure] (string-match-positions REGEXP STRING ) 128 86 129 Matches the regular expression in {{REGEXP}} (a string or a precompiled 130 regular expression) with 131 {{STRING}} and returns either {{#f}} if the match failed, 132 or a list of matching groups, where the first element is the complete 133 match. If the optional argument {{START}} is supplied, it specifies 134 the starting position in {{STRING}}. For each matching group the 87 Matches the regular expression in {{REGEXP}} (a string or a 88 precompiled regular expression) with {{STRING}} and returns either 89 {{#f}} if the match failed, or a list of matching groups, where the 90 first element is the complete match. For each matching group the 135 91 result-list contains either: {{#f}} for a non-matching but optional 136 92 group; a list of start- and end-position of the match in {{STRING}} 137 (in the case of {{string-match-positions}}); or the matching 138 substring (in the case of {{string-match}}). Note that the exact string 139 is matched. For searching a pattern inside a string, see below. 140 Note also that {{string-match}} is implemented by calling 141 {{string-search}} with the regular expression wrapped in {{^ ... $}}. 142 If invoked with a precompiled regular expression argument (by using 143 {{ regexp}}), {{string-match}} is identical to {{string-search}}.93 (in the case of {{string-match-positions}}); or the matching substring 94 (in the case of {{string-match}}). Note that the exact string is 95 matched. For searching a pattern inside a string, see below. Note 96 also that {{string-match}} is implemented by calling {{string-search}} 97 with the regular expression wrapped in {{^ ... $}}. If invoked with a 98 precompiled regular expression argument (by using {{regexp}}), 99 {{string-match}} is identical to {{string-search}}. 144 100 145 101
Note: See TracChangeset
for help on using the changeset viewer.