diff --git a/doc/schema.md b/doc/schema.md index dbdefb2..a310c79 100644 --- a/doc/schema.md +++ b/doc/schema.md @@ -180,7 +180,7 @@ Besides, the `format` schema keyword for string values is ignored, since it is n The schema keyword `pattern` and `patternProperties` uses regular expression to match the required pattern. -RapidJSON implemented a simple DFA regular expression engine, which is used by default. It supports the following syntax. +RapidJSON implemented a simple NFA regular expression engine, which is used by default. It supports the following syntax. |Syntax|Description| |------|-----------| diff --git a/doc/schema.zh-cn.md b/doc/schema.zh-cn.md index ca3e7f0..190285c 100644 --- a/doc/schema.zh-cn.md +++ b/doc/schema.zh-cn.md @@ -180,7 +180,7 @@ RapidJSON 通过了 [JSON Schema Test Suite](https://github.com/json-schema/JSON `pattern` 及 `patternProperties` 这两个 schema 关键字使用了正则表达式去匹配所需的模式。 -RapidJSON 实现了一个简单的 DFA 正则表达式引擎,并预设使用。它支持以下语法。 +RapidJSON 实现了一个简单的 NFA 正则表达式引擎,并预设使用。它支持以下语法。 |语法|描述| |------|-----------| diff --git a/include/rapidjson/internal/regex.h b/include/rapidjson/internal/regex.h index 8d48b66..edcb974 100644 --- a/include/rapidjson/internal/regex.h +++ b/include/rapidjson/internal/regex.h @@ -70,6 +70,10 @@ static const SizeType kRegexInvalidRange = ~SizeType(0); - \c \\r Carriage return (U+000D) - \c \\t Tab (U+0009) - \c \\v Vertical tab (U+000B) + + \note This is a Thompson NFA engine, implemented with reference to + Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).", + https://swtch.com/~rsc/regexp/regexp1.html */ template class GenericRegex {