Created
March 1, 2011 20:15
-
-
Save MrDys/849799 to your computer and use it in GitHub Desktop.
LC regexps
This file contains 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
// Gives you the letter chunk at the beginning (PQ, in this case) | |
preg_match_all("/^[A-Z]{1,2}/", "PQ3979.2.M28 L33 1992", $letter); | |
// Gives you the numbers (I only really care about $number[0][0], so this is fine) | |
preg_match_all("/[0-9]{1,4}/", "PQ3979.2.M28 L33 1992", $number); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment