class_docstr: Synchronize by starting at a line that matches the given regex pattern.
docstr: Create a :class:`.RegexSync` instance for this Pygments lexer class.
docstr_tok: ["Create","a",":","class",":","`",".RegexSync","`","instance","for","this","Pygments","lexer","class","."]
code: def from_pygments_lexer_cls(cls, lexer_cls):
      """
      Create a :class:`.RegexSync` instance for this Pygments lexer class.
      """
      patterns = {
          # For Python, start highlighting at any class/def block.
          "Python": r"^\s*(class|def)\s+",
          "Python 3": r"^\s*(class|def)\s+",
          # For HTML, start at any open/close tag definition.
          "HTML": r"<[/a-zA-Z]",
          # For javascript, start at a function.
          "JavaScript": r"\bfunction\b"
          # TODO: Add definitions for other languages.
          #       By default, we start at every possible line.
      }
      p = patterns.get(lexer_cls.name, "^")
      return cls(p)
  
imports: from __future__ import unicode_literals
  from abc import ABCMeta, abstractmethod
  from six import with_metaclass
  from six.moves import range
  from prompt_toolkit.token import Token
  from prompt_toolkit.filters import to_cli_filter
  from .utils import split_lines
  import re
  import six
label_desc: Use image node_id 3 for calling the RegexSync obj's underlying member method code with example usage: obj.from_pygments_lexer_cls(cls, lexer_cls) and returns: cls