メインコンテンツへスキップ
Z

What is Regular expression?

A regular expression (regex) is a pattern that describes a set of strings, used to search, match, validate and replace text. Built from literal characters and special metacharacters (like . * + ? [ ] ( )), it is supported by virtually every programming language and text editor.

Regex combines literals with metacharacters: . matches any character, */+/? are quantifiers, [...] is a character class, ( ) groups, and ^/$ anchor to start/end. For example ^\d{3}-\d{4}$ matches a 7-digit phone number.

Regexes power form validation (emails, URLs), search-and-replace, log parsing and tokenizing — but complex patterns can be hard to read, so keep them documented.

Regular expression tools

よくある質問

どのバージョンのXPathに対応していますか?

XPath 1.0です。これはブラウザがネイティブに対応しているバージョンです。XPath 2.0/3.0の機能(正規表現、シーケンス、データ型など)にはまだ対応していません。

HTMLクエリで結果が返ってこないのはなぜですか?

HTMLモードでは、入力したコードが自動的に <code class="font-mono">html/body</code> でラップされます。これに合わせて式を調整してください(例: <code class="font-mono">//body//div</code>)。

関連ツールはありますか?

JSONを検証するには <a class="text-brand-600 hover:underline" href="/jsonpath-tester">JSONPath Tester</a>、事前にXMLを整形するには <a class="text-brand-600 hover:underline" href="/xml-formatter">XML Formatter</a> をご利用ください。