<?php $str = "example ## string";if (preg_match('~#{1,6}~', $str, $m, PREG_OFFSET_CAPTURE)) { print_r($m);}
Standard input is empty
Array ( [0] => Array ( [0] => ## [1] => 8 ) )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!