Skip to content

Commit faddb99

Browse files
committed
fix regexes
1 parent 81d6c64 commit faddb99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/types/package_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl std::str::FromStr for PackageId {
132132
/// Attempts to parse a `PackageId` from a string. The string must match the pattern
133133
/// of two segments containing only lowercase letters, numbers and hyphens, separated by a colon.
134134
fn from_str(input: &str) -> Result<Self, Self::Err> {
135-
let re = regex::Regex::new(r"^[a-z0-9-]+:[a-z0-9-]+$").unwrap();
135+
let re = regex::Regex::new(r"^[a-z0-9-]+:[a-z0-9-.]+$").unwrap();
136136
if !re.is_match(input) {
137137
return Err(ProcessIdParseError::InvalidCharacter);
138138
}

src/types/process_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl std::str::FromStr for ProcessId {
3939
/// Attempts to parse a `ProcessId` from a string. The string must match the pattern
4040
/// of three segments containing only lowercase letters, numbers and hyphens, separated by colons.
4141
fn from_str(input: &str) -> Result<Self, ProcessIdParseError> {
42-
let re = regex::Regex::new(r"^[a-z0-9-]+:[a-z0-9-]+:[a-z0-9-]+$").unwrap();
42+
let re = regex::Regex::new(r"^[a-z0-9-]+:[a-z0-9-]+:[a-z0-9-.]+$").unwrap();
4343
if !re.is_match(input) {
4444
return Err(ProcessIdParseError::InvalidCharacter);
4545
}

0 commit comments

Comments
 (0)