Help check the link for the presence of a file extension at the end, that is, there is a dot and file types behind it (.html; .htm; .png; .jpeg, etc.).
For example, a reference like component/tv/samsung/21.html
- must match a specific regular expression.
I tried to make up and here's what I got:
if (preg_match('/^component\/([a-zA-Z-_0-9]*)\/([a-zA-Z-_0-9]*)\/(.+)$/i', 'component/tv/samsung/21.html', $matches)) { print_r($matches); }
But I would like to replace (. +) With a more stringent condition. Help, who knows.