League\CommonMark\Util\RegexHelper::getInstance PHP Method

getInstance() public static method

public static getInstance ( ) : RegexHelper
return RegexHelper
    public static function getInstance()
    {
        if (self::$instance === null) {
            self::$instance = new self();
        }
        return self::$instance;
    }

Usage Example

 /**
  * Attempt to parse link title (sans quotes)
  *
  * @param Cursor $cursor
  *
  * @return null|string The string, or null if no match
  */
 public static function parseLinkTitle(Cursor $cursor)
 {
     if ($title = $cursor->match(RegexHelper::getInstance()->getLinkTitleRegex())) {
         // Chop off quotes from title and unescape
         return RegexHelper::unescape(substr($title, 1, strlen($title) - 2));
     }
 }
All Usage Examples Of League\CommonMark\Util\RegexHelper::getInstance