freemarker.cache

## Class PathRegexMatcher

- java.lang.Object
- - freemarker.cache.TemplateSourceMatcher
  - - freemarker.cache.PathRegexMatcher

    public class PathRegexMatcher
    extends TemplateSourceMatcher

Matches the whole template source name (also known as template source path) with the given regular expression. Note that the template source name is relative to the template storage root defined by the `TemplateLoader`; it's not the full path of a file on the file system.

Since:
  2.3.24

### Constructor Summary

Constructors
Constructor and Description
`PathRegexMatcher(String regex)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `matches(String sourceName, Object templateSource)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PathRegexMatcher

    public PathRegexMatcher(String regex)

Parameters:
  `regex` - Glob with the syntax defined by `StringUtil.globToRegularExpression(String)`. Must not start with `/`.

### Method Detail

#### matches

    public boolean matches(String sourceName,
                           Object templateSource)
                    throws IOException

Throws:
  `IOException`