code: def regex_escape(s):
      """Escapes all regular expression meta characters in *s*
  
      The string returned may be safely used as a literal in a regular
      expression.
  
      This function is more precise than :func:`re.escape`, the latter escapes
      all non-alphanumeric characters which can cause cross-platform
      compatibility issues.
  
      References:
  
      - https://github.com/rust-lang/regex/blob/master/regex-syntax/src/lib.rs#L1685
      - https://github.com/rust-lang/regex/blob/master/regex-syntax/src/parser.rs#L1378
      """
      escaped_string = ""
      for c in s:
          if c in REGEX_PUNCT:
              escaped_string += "\\"
          escaped_string += c
      return escaped_string
  
imports: from __future__ import unicode_literals
  import importlib
  import json
  import numbers
  import re
  from builtins import bytes, str
  from datetime import datetime
  from functools import wraps
  from pathlib import Path
  from future.utils import text_type
  from snips_nlu.constants import END, ENTITY_KIND, RES_MATCH_RANGE, RES_VALUE, START
  from snips_nlu.exceptions import NotTrained, PersistingError
label_desc: Use image node_id 1 for calling a global function with example usage: regex_escape(s) and returns: escaped_string