Just to make a distinction between all regexes:
(.ico$)(.png$) really means:
Code: Select all
(
. // any character
ico // followed by 'ico'
$ // followed by the end of the string
)
(
. // followed by any character
png // followed by 'png'
$ // followed by the end of the string
)
As you can see, your regex will only match strings that have two "end of string" places in them, which will never occur of course!
----------------------------------
(.ico$)|(.png$) really means:
Code: Select all
(
. // any character
ico // followed by 'ico'
$ // followed by the end of the string
)
| // OR
(
. // any character
png // followed by 'png'
$ // followed by the end of the string
)
And because of the logical OR, things will probably go right, but it will also match files that end with "pico" for example.
----------------------------------
\.(ico|png)$ really means:
Code: Select all
\. // a '.'
(
ico // followed by 'ico'
| // OR
png // by 'png'
)
$ // folowed by the end of the string