Complex sentence: It helps other templates detect what page they are on, using pattern matching on the pagename.
Split into simpler sentences: It helps other templates detect what page they are on. It uses pattern matching on the pagename.