code: def test_greedy_matching_first(doc, text, pattern, re_pattern):
      """Test that the greedy matching behavior "FIRST" is consistent with
      other re implementations."""
      matcher = Matcher(doc.vocab)
      matcher.add(re_pattern, [pattern], greedy="FIRST")
      matches = matcher(doc)
      re_matches = [m.span() for m in re.finditer(re_pattern, text)]
      for (key, m_s, m_e), (re_s, re_e) in zip(matches, re_matches):
          # matching the string, not the exact position
          assert doc[m_s:m_e].text == doc[re_s:re_e].text
  
imports: import re
  import pytest
  from spacy.attrs import IS_PUNCT, LOWER, ORTH
  from spacy.errors import MatchPatternError
  from spacy.lang.en import English
  from spacy.lang.lex_attrs import LEX_ATTRS
  from spacy.matcher import Matcher
  from spacy.tokens import Doc, Span, Token
  from spacy.vocab import Vocab
label_desc: Use image node_id 30 for calling a global function with example usage: test_greedy_matching_first(doc, text, pattern, re_pattern) without return types