Parse strings for patterns.