class_docstr: Accept strings that match a given regular expression.
  
  Args:
      default (string, optional) :
          A default value for attributes created from this property to have.
  
      help (str or None, optional) :
          A documentation string for this property. It will be automatically
          used by the :ref:`bokeh.sphinxext.bokeh_prop` extension when
          generating Spinx documentation. (default: None)
  
  Example:
  
      .. code-block:: python
  
          >>> class RegexModel(HasProps):
          ...     prop = Regex("foo[0-9]+bar")
          ...
  
          >>> m = RegexModel()
  
          >>> m.prop = "foo123bar"
  
          >>> m.prop = "foo"      # ValueError !!
  
          >>> m.prop = [1, 2, 3]  # ValueError !!
code: def __init__(
      self,
      regex: str,
      *,
      default: Init[str] = Undefined,
      help: str | None = None,
  ) -> None:
      self.regex = re.compile(regex)
      super().__init__(default=default, help=help)
  
file_path: bokeh/src/bokeh/core/property/string.py
imports: from __future__ import annotations
  import logging
  import re
  from typing import Any
  from .bases import Init
  from .primitive import String
  from .singletons import Undefined
label_desc: Use image node_id 1 to create a new Regex object from inherited base classes: String with example: obj = Regex(regex)