class_docstr: Class containing unit tests for nltk.tgrep.
class_docstr_tok: ["Class","containing","unit","tests","for","nltk.tgrep","."]
docstr: Test regex matching on nodes.
docstr_tok: ["Test","regex","matching","on","nodes","."]
code: def test_node_regex_2(self):
      """
      Test regex matching on nodes.
      """
      tree = ParentedTree.fromstring("(S (SBJ x) (SBJ1 x) (NP-SBJ x))")
      self.assertEqual(
          list(tgrep.tgrep_positions("/^SBJ/", [tree])), [[(0,), (1,)]]
      )
      # This is a regular expression that matches any node whose
      # name includes SBJ, including NP-SBJ:
      self.assertEqual(
          list(tgrep.tgrep_positions("/SBJ/", [tree])),
          [[(0,), (1,), (2,)]],
      )
  
imports: import unittest
  from nltk import tgrep
  from nltk.tree import ParentedTree
label_desc: Use image node_id 14 for calling the TestSequenceFunctions obj's underlying member method code with example usage: obj.test_node_regex_2() without return types