3v4l.org

run code in 300+ PHP versions simultaneously
<?php $field_from_db = 'Hello How are you :slight_smile::joy::_do_not_match:test test::'; $regex = '/:[a-z0-9]+(?:[-’_][a-z0-9]+)*:/i'; preg_match_all($regex, $field_from_db, $matches); var_export($matches[0]);

preferences:
23.8 ms | 405 KiB | 5 Q