Skip to content

Instantly share code, notes, and snippets.

@Ibmurai
Created August 19, 2011 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Ibmurai/1156530 to your computer and use it in GitHub Desktop.
Save Ibmurai/1156530 to your computer and use it in GitHub Desktop.
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