Commit 674990b
Anchor get_host_prefix regex to match Python behavior
Summary:
Python re.match() anchors at the start of the string, but Rust Regex::captures() finds a match anywhere. This caused get_host_prefix() to return "c" for IPv6-style hostnames like "8c50-153b-..." on Sandcastle TW hosts, while Python correctly returned empty string.
Add ^ anchor to the regex to match Python behavior.
Reviewed By: genevievehelsel
Differential Revision: D103090288
fbshipit-source-id: 9a34042a29c4ab7c5567bf0e24b678b9d5bc79671 parent eb7e1a4 commit 674990b
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
0 commit comments