Expresiones Regulares Mysql
Quantifiers * + ? {3} {3,} {3,5} 0 or more 1or more 0 or 1 Exactly 3 3 or more 3, 4 or 5
Groups and Ranges . (a|b) (...) (?:...) [abc] [^abc] [a-q] [A-Q] [0-7] \n Any character except new line (\n) a or b Group Passive Group Range (a or bor c) Not a or b or c Letter between a and q Upper case letter between A and Q Digit between 0 and 7 nth group/subpattern Note: Ranges are inclusive. Pattern Modifiers g Global matchCase-insensitive Multiple lines Treat string as single line Allow comments and white space in pattern e U Evaluate replacement Ungreedy pattern
Quantifier Modifiers "x" below represents a quantifier x?Ungreedy version of "x"
Character Classes \c \s \S \d \D \w \W \x \O POSIX [:upper:] [:lower:] [:alpha:] [:alnum:] [:digit:] [:xdigit:] [:punct:] [:blank:] [:space:] [:cntrl:] [:graph:] [:print:][:word:] Upper case letters Lower case letters All letters Digits and letters Digits Hexadecimal digits Punctuation Space and tab Blank characters Control characters Printed characters Printedcharacters and spaces Digits, letters and underscore Assertions ?= ?! ? . * + ?
i m s x
String Replacement (Backreferences) $n $2 $1 $` $' $+ $& nth non-passive group "xyz" in /^(abc(xyz))$/ "xyz"in /^(?:abc)(xyz)$/ Before matched string After matched string Last matched string Entire matched string
Will Match Letters, numbers and hyphens Date (e.g. 21/3/2006) jpg, gif or png image Anynumber from 1 to 50 inclusive Valid hexadecimal colour code String with at least one upper case letter, one lower case letter, and one digit (useful for passwords).(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6}) (\]+)\>)
Email addresses HTML Tags
Note: These patterns are intended for reference purposes and have not been extensively tested. Please use with caution and test thoroughly before use.
Regístrate para leer el documento completo.