Jump to content

format as a regular expression (P1793)

From Wikidata
regex describing an identifier or a Wikidata property. When using on property constraints, ensure syntax is a PCRE
  • regex
  • regular expression
  • allowed values
  • regexp
Language Label Description Also known as
default for all languages
No label defined
    English
    format as a regular expression
    regex describing an identifier or a Wikidata property. When using on property constraints, ensure syntax is a PCRE
    • regex
    • regular expression
    • allowed values
    • regexp

    Data type

    String

    Statements

    0 references
    When used in property constraint, it should contain PCRE2 regular expression, treated as "full match". For example, "(?i)[a-z]+|\d+|" means that validated string should match /^(?:[a-z]+|\d+)$/i or be set to "no value" or "unknown value" (English)
    0 references
    在属性约束中使用时,它应该包含 PCRE2 正则表达式,并被视为“完全匹配”。例如,"(?i)[a-z]+|\d+|" 表示验证的字符串应该匹配 /^(?:[a-z]+|\d+)$/i,或者被设置为“无值”或“未知值”。 (Chinese)
    0 references
    https://regexper.com/#$1
    1 reference
    ((?:(?:[^?+*{}()[\]\\ (English)
    https://regex101.com/?regex=$1
    0 references
    no value
    0 references

    Constraints

    ((?:(?:[^?+*{}()[\]\\|]+|\\.|\[(?:\^?\\.|\^[^\\]|[^\\^])(?:[^\]\\]+|\\.)*\]|\((?:\?[:=!]|\?<[=!]|\?>)?(?1)??\)|\(\?(?:R|[+-]?\d+)\))(?:(?:[?+*]|\{\d+(?:,\d*)?\})[?+]?)?|\|)*)
    [A-z] will match some punctuation characters as well. Use [A-Za-z] instead if this should match uppercase and lowercase a to z. (English)
    [A-z] 也会匹配一些标点符号。如果只想匹配大小写字母 a 到 z,请使用 [A-Za-z]。 (Chinese)
    0 references
    Forward slashes should not be escaped. (English)
    正斜杠不应进行转义。 (Chinese)
    0 references