     ret = []
 
     while true
-      startTagIdx = str.search(/<sync/i)
+      startTagIdx = str.search(reOpenSync)
       break if nextStartTagIdx <= 0 || startTagIdx < 0
-      nextStartTagIdx = str.slice(startTagIdx+1).search(/<sync/i)+1
+      nextStartTagIdx = str.slice(startTagIdx+1).search(reOpenSync)+1
       if nextStartTagIdx > 0
         element = str.slice(startTagIdx, startTagIdx+nextStartTagIdx)
       else
         element = str.slice(startTagIdx)
 
-      lineNum += str.slice(0, startTagIdx).match(/\r\n?|\n/g)?.length or 0 
-      if isBroken = /<[a-z]*[^>]*<[a-z]*/g.test(element)
+      lineNum += str.slice(0, startTagIdx).match(reLineEnding)?.length or 0 
+      if isBroken = reBrokenTag.test(element)
         e = new Error('ERROR_BROKEN_TAGS')
         e.line = lineNum
         e.context = element


  getAvailableLanguages: (str) ->
    try
      matched = str.match(/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i)?[1] or ''
      matched = matched.replace(/(<!--|-->)/g, '')
      parsed = cssParse matched

      for rule in parsed.stylesheet.rules

        e.context = element
        @errors.push(e)

      lineNum += element.match(reLineEnding)?.length or 0

      for lang in @availableLanguages when lang.reClassName.test element
        lang = lang.lang
        break;

      lang or= @defaultLanguageCode
      element = element.replace(reLineEnding, '')
      element = element.replace(reBr, "\n")
      innerText = strip_tags(element).trim()
      lang = @getLanguage(element)
      item = {startTime, languages: {}, contents: innerText}
