matches URL pattern and replaces content