Skip to content

Commit 7011fd4

Browse files
committed
Update SerialId regex
1 parent 5f1a0ff commit 7011fd4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/ReadoutCard/ParameterTypes/SerialId.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SerialId
3131
public:
3232
/// Constructs a SerialId object using a string in the sssss[:e] format
3333
/// For example: "10241", "10241:1"
34-
/// \param string String of format "^[ \t]*[0-9]{5}:?[0-1]?[ \t]*$"
34+
/// \param string String of format "^[ \t]*([0-9]{3}|[0-9]{5}):?[0-1]?[ \t]*$"
3535
SerialId(const std::string& string);
3636

3737
SerialId(int serial, int endpoint);

src/ParameterTypes/SerialId.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace
2727

2828
bool parseSerialIdString(const std::string string, int& serial, int& endpoint)
2929
{
30-
std::regex expression("^[ \t]*[0-9]{5}:?[0-1]?[ \t]*$");
30+
std::regex expression("^[ \t]*([0-9]{3}|[0-9]{5}):?[0-1]?[ \t]*$");
3131
if (std::regex_search(string, expression)) {
3232
serial = stoi(string.substr(0, string.find(':'))); // Will return the SerialId struct
3333
endpoint = stoi(string.substr(string.find(':') + 1));

0 commit comments

Comments
 (0)