a slightly better PCRE question
My goal is to get a modicum of skill with PCRE, however I am now taking a step back from PCRE as PHP has many built in functions that seem designed to deal with common yet simple PCRE commands.
Lets say you have the following:
Code:
$string="44,.:,:-,::227,229"
where you don't know what is between two different numbers, but only commas and dashes are accepted. Actually, I already have a command for that '/[^0-9\-,]/' which will make $string="44,,-,227,229"
The plan is to reduce the ",,-," or maybe ",-,,,,,:sd." to a "-" if the number of characters is greater than one and is between two digits (ungreedy) with only digits at the beginning and end of the string.