#38 Testing Regular Expressions

Testing Regular Expressions

With PHPStorm you can test regular expressions without having to leave the IDE.

First, place the cursor on the string containing the regular expression and press Alt+Enter to invoke the intention actions and select Inject language or reference, then select RegExp (Regular Expression) from the list. This allows PHPStorm to identify the string as a regular expression.

Then, invoke the intention actions again using Alt+Enter and you should see a different list of options, select Check RegExp from the list and a popup will appear.

In this popup you can edit the regular expression and provide a sample string to compare it against.

Further Reading

Related Tips


Blog Comments powered by Disqus.