Code testing sites: A couple recent favorites

regex101.com

I learned about this site when looking over a coworker’s shoulder as he tested a regular expression. This is a great site for understanding, debugging, crafting, and testing regular expressions. Some highlights:

  • You can choose to edit/test regular expressions using PHP, JavaScript, Python, or Golang regex syntax.
  • You can enter a regular expression and see (through syntax highlighting) whether it is valid and how it breaks down.
  • The site gives you a character-by-character explanation of what the regular expression means.
  • You can type (or paste) sample text into the Test String text area, and see how the regular expression matches it.

repl.it

There are a number of online tools for interactively running code line-by-line and testing snippets of code. They come in handy when you want to see how some code will work without having to install the compiler/interpreter on your system. repl.it is impressive for the number of languages it supports. (Its name, REPL, is short for Read-Eval-Print Loop, the loop that reads a line of code, evaluates it, and prints its result.) repl.it may not be the most full-featured REPL tool for your favorite language, but it’s handy if you occaisionally want to try out code in a language you aren’t super-familiar with.

Tip: When you’ve typed in some code in the repl.it code editor, you can press Ctrl-Enter to run it. (This shortcut works in many other online editors.)

Standard