As the title suggests, I'm Looking for a regex test tool where I can test out regex lines live and instantly see if it works or not without having to press a button or things like that. Any suggestions?
Try regex101: https://regex101.com/
All results are presented as soon you edit the text so it's really easy to see what's going on live, it supports multiple languages and there's many predefined commands you can use such as digits, character intervalls, sorting, etc..
Thanks for the tip, easy to test patterns even with low regex skills.
Code works too, just print the output then run the script from a terminal using php /path/to/script.php
/path/to/script.php
Adolf You need to execute as php if you use the command line:
php /path/to/script.php