Remove numeric prefix from string - PHP regex

php, regex

Solution

Try:

preg_replace('/^[0-9]+\. +/', '', $string);

Which gives:

php > print_r(preg_replace('/^[0-9]+\. +/', '', '1231241. dfg'));
dfg

Problem

Would somebody care to help me out with a regex to reliably recognize and remove any number, followed by a dot, in the beginning of a string? So that ``` 1. Introduction ``` becomes ``` Introduction ``` and ``` 1290394958595. Appendix A ``` becomes ``` Appendix A ```

Original source