3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowed_chars = 'a-z 0-9~%.:_-'; $str = 'renewal'; if ( ! preg_match("/^[".$allowed_chars."]+$/i", $str)){ echo "Unallowed!!!!"; }else{ echo "Looks fine"; }

preferences:
36.71 ms | 402 KiB | 5 Q