public static Pattern newMustacheTagPattern ( Configuration configuration ) { StringBuilder regex = new StringBuilder ( ) ; regex . append ( Pattern . quote ( configuration . getStringPropertyValue ( EngineConfigurationKey . START_DELIMITER ) ) ) ; regex . append ( ".*?" ) ; regex . append ( Pattern . quote ( configuration . getStringPropertyValue ( EngineConfigurationKey . END_DELIMITER ) ) ) ; return Pattern . compile ( regex . toString ( ) ) ; }
Delimiters are quoted to avoid regexp reserved characters conflict .