Skip to content

Instantly share code, notes, and snippets.

@program247365
Created December 3, 2010 19:54
Show Gist options
  • Save program247365/727462 to your computer and use it in GitHub Desktop.
Save program247365/727462 to your computer and use it in GitHub Desktop.
Simple regular expression to find SSN in a string.
<?php
$string = '123-23-1234';
$pattern = '^\d{3}-\d{2}-\d{4}^';
preg_match($pattern, $string, $matches);
print_r($matches);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment