implement syntax parsing for Regex.