It is probably dead simple but I wasn't able to find the solution. I have to rewrite some topics in a database and for this I have to cut a number out of it. This is what I tried to get the "453:": preg_match('[0-9:]', "Status Update 453: News that might disturb", $matches); $result = $matches[1]; echo $result; PHP: I have a program called regexbuddy and it shows that the regex should work but it doesnt... any help would be fantastic!
<?php preg_match('/([0-9:]{4})/', "Status Update 453: News that might disturb", $matches); $result = $matches[0]; echo $result; ?> PHP: You have to add delimiters, to the start and end of the expression.