Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP, regex and double quoted strings are fun...
<?php
/* This handy script lets you locate escaped backslashes in the prettiest way. */
$input = $_POST['value'];
$matches = array();
if (preg_match("/\\\\/", $input, $matches)) {
var_dump($matches);
} else {
echo "No matching \"\\\\\"'s found.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment