Perl基礎::正規表現(regex)

正規表現(regex)

学習内容

使用するプログラムと実行コマンド(命令)

プログラムの解説

Perlの正規表現

PatternResult
.Matches any character except newline
[a-z0-9]Matches any lower-case single character of set
[^a-z0-9]Matches anything other than lower-case single characters
\ddigit [0-9]
\Dnon-digit [^0-9]
\walphanumericunderscore [a-zA-Z0-9_]
\Wnon-alphanumericunderscore
\swhitespace (including punctuations)
\Snon-whitespace
\nend-of-line
\rcarriage-return
\ttab
\btext-boundaries
\0Matches a null character
\nnnMatches a character corresponding the ASCII code (numeric)
\xnnMatches a character corresponding the ASCII code (octal)
(abc)back-reference
\1the first match
\2the second match
x?0 or 1
x*0 or more
x+1 or more
x{m,n}at least m not more than n
fee&bar;fie&bar;foeMatches one of fee, fie, or foe
^Anchors match to the beginning of a line or string
$Anchors match to the end of a line or string

予備知識

プログラムの実行

練習問題

練習1

練習2

練習3

練習4

練習5

まとめ

解答と解説

解答と解説1

解答と解説2

解答と解説3

解答と解説4

他の解答と解説4

解答と解説5 [#ya5076eb]


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2009-07-03 (金) 17:00:31 (431d)