code: def test_match_regex(self) -> None:
      with pytest.warns(UserWarning, match=r"must be \d+$"):
          warnings.warn("value must be 42", UserWarning)
  
      with pytest.warns():
          with pytest.raises(pytest.fail.Exception):
              with pytest.warns(UserWarning, match=r"must be \d+$"):
                  warnings.warn("this is not here", UserWarning)
  
      with pytest.warns():
          with pytest.raises(pytest.fail.Exception):
              with pytest.warns(FutureWarning, match=r"must be \d+$"):
                  warnings.warn("value must be 42", UserWarning)
  
imports: import warnings
  from typing import List
  from typing import Optional
  from typing import Type
  import pytest
  from _pytest.pytester import Pytester
  from _pytest.recwarn import WarningsRecorder
label_desc: Use image node_id 11 for calling the TestWarns obj's underlying member method code with example usage: obj.test_match_regex() without return types