Last active
January 18, 2017 07:57
-
-
Save frankiejarrett/7bfe487ebdd5b1ee435a3723e079b939 to your computer and use it in GitHub Desktop.
Detect serialized data with regex in MySQL - https://regex101.com/r/mXyzmI/2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Select rows that contain serialized data */ | |
| SELECT * FROM `wp_options` WHERE `option_value` RLIKE '(a:[0-9]+:{)|(s:[0-9]+:)|(i:[0-9]+;)|(O:[0-9]+:\")'; | |
| /* Select rows that don't contain serialized data */ | |
| SELECT * FROM `wp_options` WHERE `option_value` NOT RLIKE '(a:[0-9]+:{)|(s:[0-9]+:)|(i:[0-9]+;)|(O:[0-9]+:\")'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment