Prev | Current Page 1161 | Next

Michael McCallister

"openSUSE Linux Unleashed"


CHAPTER 30 Using Perl and Python 616
TABLE 30.4 Some Perl Metacharacters
Meaning Metacharacter
Match any single character (except a newline). .
Match the preceding character(s), any number of times. *
Match the preceding character(s), one or more times. +
The preceding character(s) may not be in the string, but ?
it will still match if the other requirements are present.
Boolean OR statement. |
Text matches if a tab character is present. \t
Pattern matches if it is at the beginning of a line. ^
Pattern matches if it is at the end of a line. $
Match a letter, number, or underscore. \w
Match a number. \d
Match any whitespace character such as a space, \s
tab, or newline.
Escape any metacharacter into an ordinary character. \
In addition to searching and matching text segments and character patterns, regular
expressions can also be used to validate user input. The form of expected input is
expressed as a regular expression against which the input is compared.
my $email = ;
print ???Input is in valid format??? if
$email =~ \[A-Za-z0-9.


Pages:
1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
szkolenia dla przedsiębiorców oferty spa Wczasy nad morzem projektowanie wnętrz opony michelin