The last three references for this appendix include Table B.17, how to store special characters in a database; Table B.18, how to weight keywords in a binary-mode full-text search; and Table B.19, significant characters for regular expressions.
Table B.17. These characters all have special meanings when used in queries. The letters are all case-sensitive! The percentage character and the underscore are necessary because these characters, when not escaped, can be used as wildcards in searches.
Single quotation mark
Double quotation mark
Table B.18. As of version 4 of MySQL, you can perform full-text searches in binary mode, using these symbols.
Special Boolean Mode Characters
Word is required
punk is required and rock is optional.
Word must not be present
punk is required and rock cannot be present.
A literal phrase
Occurrences of the phrase punk rock are weighted.
rock is required and punk is less significant.
rock is required but punk is more significant.
(>punk roll) +rock
rock is required, both punk and roll are optional, but punk is weighted more.
Detracts from relevance
punk is required, and the presence of rock devalues the relevance (but rock is not excluded).
Allows for wildcards
punk and rock are required, but rocks, rocker, rocking, etc., are counted.
Table B.19. When using REGEX and NOT REGEX, you'll need to define patterns with the characters listed here.
Special Regular Expression Characters
Any single character
Zero or one q
Zero or more q's
At least one q
Exactly x instances of q
At least x instances of q
Up to x instances of q
Between x and y instances of q
Starts with q
Ends with q
Grouping (matches pqr)
Either q or z
Character classes (e.g., [a-z], [0-9])
Escapes a special character (\., \*, etc.)