Skip to content

Commit

Permalink
Update README for regex
Browse files Browse the repository at this point in the history
Closes #325
  • Loading branch information
Keats committed May 3, 2024
1 parent 5dced8e commit da77371
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ static RE_TWO_CHARS: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"[a-z]{2}$").unwrap()
});

#[validate(regex = "RE_TWO_CHARS")]
#[validate(regex(path = "RE_TWO_CHARS"))]
#[validate(regex = *RE_TWO_CHARS)]
#[validate(regex(path = *RE_TWO_CHARS")]

This comment has been minimized.

Copy link
@simanacci

simanacci Jun 19, 2024

Should this be #[validate(regex(path = "*RE_TWO_CHARS")]?

This comment has been minimized.

Copy link
@Keats

Keats Jun 19, 2024

Author Owner

Not with the recent version

This comment has been minimized.

Copy link
@simanacci

simanacci Jun 19, 2024

I meant the single quote at the end. I think it's a minor typo.

This comment has been minimized.

Copy link
@Keats

Keats Jun 19, 2024

Author Owner

Ah yes the quote at the end should be removed, thanks!

```
### credit\_card
Expand Down Expand Up @@ -382,7 +382,7 @@ For example, the following attributes all work:
#[validate(credit_card(code = "code_str"))]
#[validate(length(min = 5, max = 10, code = "code_str"))]
#[validate(regex(path = "static_regex", code = "code_str"))]
#[validate(regex(path = *static_regex, code = "code_str"))]
#[validate(custom(function = "custom_fn", code = "code_str"))]
#[validate(contains(pattern = "pattern_str", code = "code_str"))]
#[validate(does_not_contain(pattern = "pattern_str", code = "code_str"))]
Expand All @@ -392,7 +392,7 @@ For example, the following attributes all work:
#[validate(url(message = "message_str"))]
#[validate(length(min = 5, max = 10, message = "message_str"))]
#[validate(regex(path = "static_regex", message = "message_str"))]
#[validate(regex(path = *static_regex, message = "message_str"))]
#[validate(custom(function = "custom_fn", message = "message_str"))]
#[validate(contains(pattern = "pattern_str", message = "message_str"))]
#[validate(does_not_contain(pattern = "pattern_str", message = "message_str"))]
Expand Down

0 comments on commit da77371

Please sign in to comment.