What functions do I need to call to use Regular Expressions in Systemverilog/UVM?
Note: I'm not asking how to use regular expressions, just method names.
What functions do I need to call to use Regular Expressions in Systemverilog/UVM?
Note: I'm not asking how to use regular expressions, just method names.
First, if you want to use regular expression, you'll need to make sure you're using a UVM library compiled together with its DPI code (i.e. the
UVM_NO_DPI
define isn't set).The methods you want to use are located in
dpi/uvm_regex.svh
. The main function isuvm_re_match(...)
, which takes as an argument a regular expression and the string to match against. This is basically a wrapper around theregexec(...)
C function found in theregex.h
library. It will return0
on a match.Another function you might want to use is
uvm_glob_to_re(...)
which can convert from a glob expression (the kind you get in a Linux shell) to a true regular expression.