----------------------------------------------------------------------- -- Supposed QRegExp 4.4.0 Regular Expression syntax grammar derived -- from documentation (http://doc.trolltech.com/4.4/qregexp.html) -- Copyright (C) 2008, Sebastian Pipping -- License under the New BSD License -- 1.1, 2008-05-29 ----------------------------------------------------------------------- expression = branch ("|" expression) branch = atom (quantifier) (branch) | assertion (branch) atom = group | "." // any-char class | predef // predefined classes | custom // custom classes | "\\" [afnrtnv] // special char | "\\" "x" [0-9a-fA-F]{4} // hex char | "\\" "0" [0-7]{3} // oct char | "\\" [1-9][0-9]* // back reference | "\\" [^afnrtnvdDsSwWx0-9] // escaped char matching itself | [^\\\\$()*+.?\\[\\]^{|}] // literal char matching itself group = "(" expression ")" | "(?:" expression ")" predef = "\\" [dDsSwW] custom = "[" ("^") custom2 custom2 = [^\\]-] custom3 // potential range start | "\\]" custom3 // potential range start | predef custom4 | "-" "]" custom3 = "-" "\\]" custom4 // range complete | "-" [^\\]-] custom4 // range complete | predef custom4 | "-" "]" | "]" custom4 = [^\\]-] custom3 // potential range start | "\\]" custom3 // potential range start | predef custom4 | "-" "]" | "]" quantifier = "?" | "+" | "*" | "{" (number) "," (number) "}" number = [0-9]+ assertion = "(?=" expression ")" | "(?!" expression ")" | "^" | "$" | "\\b" | "\\B"