code: def find_metadata_tokens(pattern):
      """Return a list of strings which are the metadata token names in a pattern
  
      pattern - a regexp-like pattern that specifies how to find
                metadata in a string. Each token has the form:
                "(?<METADATA_TAG>...match-exp...)" (matlab-style) or
                "\g<METADATA_TAG>" (Python-style replace)
                "(?P<METADATA_TAG>...match-exp..)" (Python-style search)
      """
      result = []
      while True:
          m = re.search("\\(\\?[<](.+?)[>]", pattern)
          if not m:
              m = re.search("\\\\g[<](.+?)[>]", pattern)
              if not m:
                  m = re.search("\\(\\?P[<](.+?)[>]", pattern)
                  if not m:
                      break
          result.append(m.groups()[0])
          pattern = pattern[m.end() :]
      return result
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/utilities/measurement.py
imports: import os
  import re
  import sys
  import tempfile
  from .hdf5_dict import get_top_level_group
  from .hdf5_dict import VERSION
label_desc: Use image node_id 5 for calling a global function with example usage: find_metadata_tokens(pattern) and returns: result