Skip to content

Instantly share code, notes, and snippets.

@wraithan
Created August 2, 2011 18:32
Show Gist options
  • Save wraithan/1120848 to your computer and use it in GitHub Desktop.
Save wraithan/1120848 to your computer and use it in GitHub Desktop.
find \w\w-\d+ unless it is at the end of a url:
example.com/browse/AM-3245 -- No Match
blah blah blah AM-3245 bah -- AM-3245
AM-3245 blah blah -- AM-3245
AM-3245 -- AM-3245
/\b(\w\w-\d+)/ is what I have currently which matches in all of the above cases, instead of not matching on the url.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment