Use NS_PATTERN_STR instead of compiled regex
#979
Merged
NS_PATTERN_STR instead of compiled regex
#979