1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

expr: Handle special cases for ^ in regex

This commit is contained in:
Teemu Pätsi 2025-05-23 15:22:18 +03:00
parent 6a828f0e74
commit f664578a4b
No known key found for this signature in database
2 changed files with 19 additions and 4 deletions

View file

@ -282,6 +282,14 @@ fn test_regex() {
.args(&["a^b", ":", "a\\^b"])
.succeeds()
.stdout_only("3\n");
new_ucmd!()
.args(&["b", ":", "a\\|^b"])
.succeeds()
.stdout_only("1\n");
new_ucmd!()
.args(&["ab", ":", "\\(^a\\)b"])
.succeeds()
.stdout_only("a\n");
new_ucmd!()
.args(&["a$b", ":", "a\\$b"])
.succeeds()