Skip to content

Instantly share code, notes, and snippets.

@JohannesFischer
Last active May 12, 2021 01:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohannesFischer/ce5b65d5aba5c4b8f48915d3b1fbd456 to your computer and use it in GitHub Desktop.
Save JohannesFischer/ce5b65d5aba5c4b8f48915d3b1fbd456 to your computer and use it in GitHub Desktop.
My solutions for Regex Golf - https://alf.nu/RegexGolf
# Warmup – Type a regex in the box.
foo
# Anchors – You are deducted one point per character you use, and ten if you match something you shouldn't.
ick$
# It never ends – $ not allowed
fu\b
# Ranges – The test vectors were generated by grepping /usr/dict/words. Can you tell?
[a-f]{4,}
# Backrefs – This doesn't really work as a tutorial. Not really clear what you're supposed to do here.
(\w{3,})\w*\1\w*
# Abba – Let's pretend this one is not a rehash of the last one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment