aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/constants.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/host/include/uhd/rfnoc/constants.hpp b/host/include/uhd/rfnoc/constants.hpp
index 68833430c..fdcc40d99 100644
--- a/host/include/uhd/rfnoc/constants.hpp
+++ b/host/include/uhd/rfnoc/constants.hpp
@@ -89,7 +89,11 @@ static const size_t MAX_NUM_PORTS = 16;
// Regular expressions
static const std::string VALID_BLOCKNAME_REGEX = "[A-Za-z][A-Za-z0-9_]*";
+static const std::string DEVICE_NUMBER_REGEX = R"-((?:(\d+)/)?)-";
+static const std::string BLOCK_COUNTER_REGEX = R"-((?:#(\d+))?)-";
static const std::string VALID_BLOCKID_REGEX =
- "(?:(\\d+)(?:/))?([A-Za-z][A-Za-z0-9_]*)(?:(?:#)(\\d\\d?))?";
+ DEVICE_NUMBER_REGEX + "(" + VALID_BLOCKNAME_REGEX + ")" + BLOCK_COUNTER_REGEX;
+static const std::string MATCH_BLOCKID_REGEX =
+ DEVICE_NUMBER_REGEX + "(" + VALID_BLOCKNAME_REGEX + ")?" + BLOCK_COUNTER_REGEX;
}} /* namespace uhd::rfnoc */