string.match
code:Lua
t = textmodule.string.match(str, pattern, num)
モジュール
string
引数
table:_
変数 型 概要
1 str string 元の文字列
2 pattern string 検索文字列(正規表現)
3 num number 検索開始位置(省略可)
返り値
table:_
変数 型 概要
1 t string 処理された文字列
概要
strと正規表現パターンpatternを比較して、最初にマッチした部分を返す。
numで検索を開始する位置を指定できるが、指定しない場合は1になる。