Data & text · ALIAS

re

Alias for regex. Regular-expression helpers.

re is an alias of regex and shares the same API.

Quick start

use re
use re

email = "hello@example.com"
say re.search "@" email
say re.replace "example" email "se"

API reference

re.match pattern text

Check whether all Text matches a regex.

檢查是否 all Text matches a regex.
re.search pattern text

Search Text with a regex.

Search Text with a regex.
re.replace pattern text replacement

Regex replacement.

Regex replacement.
re.split pattern text

Split Text with a regex.

Split Text with a regex.