15+ results for 'email address regex lang:rust' (0 ms)

Not the results you expected?

node.rs (https://gitlab.com/nwagg14/zinc) Rust 路 168 lines

119 pub count: Spanned<u32>,

120 pub docstring: Option<Spanned<ast::Ident>>,

121 pub address: usize,

122 }

123

thirdparty.rs (https://github.com/ruma/ruma.git) Rust 路 200 lines

121 pub struct FieldType {

122 /// A regular expression for validation of a field's value.

123 pub regexp: String,

124

125 /// A placeholder serving as a valid example of the field value.

134 pub struct FieldTypeInit {

135 /// A regular expression for validation of a field's value.

136 pub regexp: String,

137

138 /// A placeholder serving as a valid example of the field value.

142 impl From<FieldTypeInit> for FieldType {

143 fn from(init: FieldTypeInit) -> Self {

144 let FieldTypeInit { regexp, placeholder } = init;

145 Self { regexp, placeholder }

193 #[serde(rename_all = "lowercase")]

194 pub enum Medium {

195 /// Email address identifier

196 Email,

django.po (http://google-blog-converters-appengine.googlecode.com/svn/trunk/) Unknown 路 288 lines

102 #: forms.py:191

103 msgid ""

104 "That e-mail address doesn't have an associated user account. Are you sure "

105 "you've registered?"

106 msgstr ""

110 #: forms.py:193

111 msgid ""

112 "The user account associated with this e-mail address cannot reset the "

113 "password."

114 msgstr ""

209

210 #: models.py:237

211 msgid "e-mail address"

212 msgstr "endere鏾 de e-mail"

213

string_validators.rs (https://github.com/async-graphql/async-graphql.git) Rust 路 104 lines

2 use crate::Value;

3 use once_cell::sync::Lazy;

4 use regex::Regex;

5

6 /// String minimum length validator

52 }

53

54 static EMAIL_RE: Lazy<Regex> = Lazy::new(|| {

55 Regex::new("^(([0-9A-Za-z!#$%&'*+-/=?^_`{|}~&&[^@]]+)|(\"([0-9A-Za-z!#$%&'*+-/=?^_`{|}~ \"(),:;<>@\\[\\\\\\]]+)\"))@").unwrap()

73 }

74

75 static MAC_ADDRESS_RE: Lazy<Regex> =

76 Lazy::new(|| Regex::new("^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$").unwrap());

77 static MAC_ADDRESS_NO_COLON_RE: Lazy<Regex> =

78 Lazy::new(|| Regex::new("^[0-9a-fA-F]{12}$").unwrap());

mod.rs (https://github.com/mozilla/fxa.git) Rust 路 82 lines

73

74 pub mod duration;

75 pub mod email_address;

76 pub mod env;

77 pub mod error;

79 pub mod logging;

80 pub mod provider;

81 pub mod regex;

82 pub mod validate;

83

regex.rs (https://github.com/ChrisBuchholz/accord.git) Rust 路 111 lines

1 use regex::RegexBuilder;

2

3 /// Enforce that a string must match a given regex

15 pub fn regex(regex: &'static str, flags: &'static str) -> Box<Fn(&String) -> ::ValidatorResult> {

16 let regex = RegexBuilder::new(regex)

17 .case_insensitive(flags.contains("i"))

18 .multi_line(flags.contains("m"))

32 args: vec![regex.as_str().to_owned(), flags.to_owned()],

33 human_readable: format!("Must match regex '/{}/{}'", regex.as_str().clone(), flags)

34 })

35 }

37 }

38

39 /// Convenience function for validating email addresses

40 pub fn email() -> Box<Fn(&String) -> ::ValidatorResult> {

72 assert!(email()(&"asdf@asdf.com".to_owned()).is_ok());

73 assert!(email()(&"amazing.email.address@super.amazing.site.tk".to_owned()).is_ok());

74 assert!(email()(&"prick@legal.google".to_owned()).is_ok());

constants.rs (https://github.com/minio/minsql.git) Rust 路 53 lines

16

17 // Server Defaults

18 pub const DEFAULT_SERVER_ADDRESS: &str = "0.0.0.0:9999";

19

20 // Smart Fields

21 pub const SF_IP: &str = "$ip";

22 pub const SF_EMAIL: &str = "$email";

23 pub const SF_DATE: &str = "$date";

24 pub const SF_QUOTED: &str = "$quoted";

28

29 pub const SMART_FIELDS_RAW_RE: &str =

30 r"((\$(ip|email|date|url|quoted|phone|user_agent))([0-9]+)*)\b";

31

32 // MIME Types

users.rs (https://github.com/fairingrey/actix-realworld-example-app.git) Rust 路 191 lines

1 use actix_web::{HttpRequest, HttpResponse, web::Json, ResponseError, web::Data};

2 use futures::{future::result, Future};

3 use regex::Regex;

4 use std::convert::From;

5 use validator::Validate;

14

15 lazy_static! {

16 static ref RE_USERNAME: Regex = Regex::new(r"^[_0-9a-zA-Z]+$").unwrap();

17 }

18

38 )]

39 pub username: String,

40 #[validate(email(message = "fails validation - is not a valid email address"))]

41 pub email: String,

50 #[derive(Debug, Validate, Deserialize)]

51 pub struct LoginUser {

52 #[validate(email(message = "fails validation - is not a valid email address"))]

53 pub email: String,

lib.rs (https://github.com/robinst/linkify.git) Rust 路 120 lines

1 //! Linkify finds links such as URLs and email addresses in plain text.

2 //! It's smart about where a link ends, such as with trailing punctuation.

3 //!

4 //! Your reaction might be: "Do I need a library for this? Why not a regex?".

5 //! Let's look at a few cases:

6 //!

18 //! It uses a simple scan with linear runtime.

19 //!

20 //! In addition to URLs, it can also find emails.

21 //!

22 //! ### Usage

88 //!

89 //! * [RFC 3986] and [RFC 3987] for URLs

90 //! * [RFC 5321] and [RFC 6531] for emails (except IP addresses and quoting)

91 //!

92 //! At the same time, it does not guarantee that the returned links are valid.

mod.rs (https://github.com/mozilla/fxa.git) Rust 路 89 lines

14 //! or wiring in request parameters.

15

16 use regex::Regex;

17 use rusoto_core::Region;

18

24 static ref AWS_SECRET_FORMAT: Regex = Regex::new("^[A-Za-z0-9+/=]+$").unwrap();

25 static ref BASE_URI_FORMAT: Regex = Regex::new(

26 r"^https?://[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*(?::[0-9]+)?/(?:[A-Za-z0-9-]+/)*$"

27 ).unwrap();

28 static ref EMAIL_ADDRESS_FORMAT: Regex = Regex::new(

29 r"^[a-zA-Z0-9.\pL\pN!#$%&'*+/=?^_`{|}~-]{1,64}@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)+$"

30 ).unwrap();

33 Regex::new(r"^[A-Za-z0-9-]+(?: [A-Za-z0-9-]+)*$").unwrap();

34 static ref SENDGRID_API_KEY_FORMAT: Regex = Regex::new("^[A-Za-z0-9._-]+$").unwrap();

35 static ref SENTRY_DSN_FORMAT: Regex =

validate.rs (https://github.com/GREsau/schemars.git) Rust 路 121 lines

4 use util::*;

5

6 // In real code, this would typically be a Regex, potentially created in a `lazy_static!`.

7 static STARTS_WITH_HELLO: &'static str = r"^[Hh]ello\b";

8

20 #[validate(regex(path = "STARTS_WITH_HELLO", code = "foo"))]

21 regex_str2: String,

22 #[validate(regex(pattern = r"^\d+$"))]

28 #[validate(email)]

29 email_address: String,

30 #[validate(phone)]

31 tel: String,

67 #[schemars(regex = "STARTS_WITH_HELLO")]

68 regex_str1: String,

69 #[schemars(regex(path = "STARTS_WITH_HELLO"))]

78 #[schemars(email)]

79 email_address: String,

80 #[schemars(phone)]

81 tel: String,

res_debug.h (http://opensource.apple.com/release/mac-os-x-1074/) C++ Header 路 59 lines

44 # <span class="enscript-reference">define</span> <span class="enscript-function-name">Dprint</span>(cond, args) <span class="enscript-comment">/*empty*/</span>

45 # <span class="enscript-reference">define</span> <span class="enscript-function-name">DprintQ</span>(cond, args, query, size) <span class="enscript-comment">/*empty*/</span>

46 # <span class="enscript-reference">define</span> <span class="enscript-function-name">Aerror</span>(statp, file, string, error, address) <span class="enscript-comment">/*empty*/</span>

47 # <span class="enscript-reference">define</span> <span class="enscript-function-name">Perror</span>(statp, file, string, error) <span class="enscript-comment">/*empty*/</span>

48 #<span class="enscript-reference">else</span>

string_validators.rs (https://github.com/sunli829/async-graphql.git) Rust 路 153 lines

1 use once_cell::sync::Lazy;

2 use regex::Regex;

3

4 use crate::validators::InputValueValidator;

101 }

102

103 static EMAIL_RE: Lazy<Regex> = Lazy::new(|| {

104 Regex::new("^(([0-9A-Za-z!#$%&'*+-/=?^_`{|}~&&[^@]]+)|(\"([0-9A-Za-z!#$%&'*+-/=?^_`{|}~ \"(),:;<>@\\[\\\\\\]]+)\"))@").unwrap()

122 }

123

124 static MAC_ADDRESS_RE: Lazy<Regex> =

125 Lazy::new(|| Regex::new("^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$").unwrap());

126 static MAC_ADDRESS_NO_COLON_RE: Lazy<Regex> =

127 Lazy::new(|| Regex::new("^[0-9a-fA-F]{12}$").unwrap());

defaults.rs (https://github.com/Internet-of-People/mercury-rust.git) Rust 路 87 lines

4

5 pub fn get() -> Vec<SchemaVersion> {

6 vec![age_over(), email_address(), full_name()]

7 }

8

28 }

29

30 fn email_address() -> SchemaVersion {

31 SchemaVersion::new(

32 "McL9746fWtE9EXVb",

33 "iop",

34 "email-address",

35 0,

36 json![{

main.rs (https://gitlab.com/owbone/rust-e) Rust 路 108 lines

22

23 extern crate getopts;

24 extern crate regex;

25

26 mod irc;

40 fn main() {

41 let mut opts = Options::new();

42 opts.optopt("s", "server", "Address", "ADDRESS");

43 opts.optopt("p", "port", "Port", "PORT");

44

49 Ok(m) => { m }

50 Err(e) => {

51 println!("Invalid address: {}", e);

52 return usage(&program, opts);

53 }