Skip to content

Commit

Permalink
Merge pull request #382 from giacomd/augeas_canonical
Browse files Browse the repository at this point in the history
Extend canonical augeas lens regex (fixes #345)
  • Loading branch information
smortex authored Feb 7, 2024
2 parents ff66418 + c07918c commit 5284189
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/augeas/lenses/postfix_canonical.aug
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let space_or_eol (sep:regexp) (default:string) =
del (space_or_eol_re? . sep . space_or_eol_re?) default

(* View: word *)
let word = store /[A-Za-z0-9@\*.+-]+/
let word = store /[A-Za-z0-9@\*.+-_!$&'=?^`{|}~]+/

(* View: comma *)
let comma = space_or_eol "," ", "
Expand Down
4 changes: 4 additions & 0 deletions lib/augeas/lenses/test_postfix_canonical.aug
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let conf = "# a comment
user@domain.com @domain
@otherdomain @otherotherdomain
someuser Full.Some.User
anotheruser another_user+mail=address@domain
"

(* Test: Postfix_Canonical.lns *)
Expand All @@ -24,3 +25,6 @@ test Postfix_Canonical.lns get conf =
{ "pattern" = "someuser"
{ "destination" = "Full.Some.User" }
}
{ "pattern" = "anotheruser"
{ "destination" = "another_user+mail=address@domain" }
}

0 comments on commit 5284189

Please sign in to comment.