PageRenderTime 878ms queryFilters 0ms Sphinxql 366ms GetByIds 334ms meta 0ms repositoryFilters 9ms languageFilters 1ms sourceFilters 90ms

13,122 results for 'email address regex' (878 ms)

Source

Language

Repository

email-address-encoder.php https://github.com/pica-design/nextstepmaine.git | PHP | 136 lines
4Plugin URI: http://tillkruess.com/project/email-address-encoder/
5Description: A lightweight plugin to protect email addresses from email-harvesting robots by encoding them into decimal and hexadecimal entities.
6Version: 1.0.4
28 *
29 * @package Email Address Encoder
30 * @copyright 2013 Till Kr端ss
39/**
40 * Register filters to encode exposed email addresses in
41 * posts, pages, excerpts, comments and widgets.
66
67	// override regex pattern with the 'eae_regexp' filter
68	$regexp = apply_filters(
108 *
109 * @param string $string Text with email addresses to encode
110 * @return string $string Given text with encoded email addresses
jquery.email-address-de-obfuscator.js.coffee https://github.com/michaelglass/email-address-de-obfuscator.git | CoffeeScript | 60 lines
1# Plugin Email Address De-Obfuscator by Alan Hogan, 2013
2#
4#
5# Project home on GitHub: https://github.com/alanhogan/email-address-de-obfuscator
6#
11(($, window) ->
12  $.extend $.fn, deObfuscateEmailAddresses: (options) ->
13    @defaultOptions = 
17      replacements:  [
18        # Using CoffeeScript's expanded regex syntax. It is love.
19        [
44        $anchor = $(anchor)
45        address = $anchor.data settings.dataKey
46        if address
51        for replacement in settings.replacements
52          address = address.replace replacement[0], replacement[1]
53        $anchor.text(address) if fromText
email.rb https://github.com/gcao/cool_games.git | Ruby | 56 lines
1module CoolGames
2  class Email
3    # http://tfletcher.com/lib/rfc822.rb
4    #
5    # RFC822 Email Address Regex
6    # --------------------------
8    # Originally written by Cal Henderson
9    # c.f. http://iamcal.com/publish/articles/php/parsing_email/
10    #
51      
52    def self.valid? email
53      email =~ FORMAT
Address.java https://github.com/SOKP-1/packages_apps_UnifiedEmail.git | Java | 463 lines
157        Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(addressList);
158        ArrayList<Address> addresses = new ArrayList<Address>();
159        for (int i = 0, length = tokens.length; i < length; ++i) {
167                    }
168                    addresses.add(new Address(address, name));
169                }
180    static boolean isValidAddress(final String address) {
181        return EMAIL_ADDRESS.matcher(address).find();
182    }
194            // Leave unchanged for now (i.e. case-sensitive).
195            return getAddress().equals(((Address) o).getAddress());
196        }
430            } else {
431                address = new Address(addressList.substring(pairStartIndex, addressEndIndex),
432                                      addressList.substring(addressEndIndex + 1, pairEndIndex));
Address.java https://github.com/SOKP-1/packages_apps_UnifiedEmail.git | Java | 548 lines
72
73    private static final Address[] EMPTY_ADDRESS_ARRAY = new Address[0];
74
115
116    public static synchronized Address getEmailAddress(String rawAddress) {
117        if (TextUtils.isEmpty(rawAddress)) {
215        Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(addressList);
216        ArrayList<Address> addresses = new ArrayList<Address>();
217        for (int i = 0, length = tokens.length; i < length; ++i) {
257            // Leave unchanged for now (i.e. case-sensitive).
258            return getAddress().equals(((Address) o).getAddress());
259        }
453            } else {
454                address = new Address(addressList.substring(addressEndIndex + 1, pairEndIndex),
455                        addressList.substring(pairStartIndex, addressEndIndex));
email.rb https://github.com/eliasdorneles/WhatWeb.git | Ruby | 58 lines
10# Version 0.5
11# find all email addresses, return only unique addresses, rename to email
12##
20# removed :certainty
21# end at an optional ?, return the email address as a :string
22##
25version "0.6"
26description "Extract email addresses. Find valid email address and syntactically invalid email addresses from mailto: link tags. We match syntactically invalid links containing mailto: to catch anti-spam email addresses, eg. bob at gmail.com. This uses the simplified email regular expression from http://www.regular-expressions.info/email.html for valid email address matching."
27
29# The regex will only detect anti-spam e-mail addresses if present in "mailto:"
30# The regex does not validate e-mail addresses in "mailto:"
31#
47
48	# Detect valid email address in the page
49	{ :string=>/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i },
zend.form.element.email.rst https://github.com/gullij/zf2-documentation.git | Unknown | 120 lines
25   $email = new Element\Email('email');
26   $email->setLabel('Email Address')
27   $form->add($email);
29   // Comma separated list of emails
30   $emails = new Element\Email('emails');
31   $emails
84   If the ``multiple`` attribute is true, a ``Zend\Validator\Explode`` validator will be added to ensure the input
85   string value is split by commas before validating each email address with ``Zend\Validator\Regex``.
86
103
104   Sets the email validator to use for multiple or single email addresses.
105
118.. _`HTML5 inputs with type email`: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-(type=email)
119.. _`HTML5 valid email address`: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
120
zend.form.element.email.rst https://github.com/Xerkus/zf2-documentation.git | Unknown | 122 lines
27   $email = new Element\Email('email');
28   $email->setLabel('Email Address')
29   $form->add($email);
31   // Comma separated list of emails
32   $emails = new Element\Email('emails');
33   $emails
86   If the ``multiple`` attribute is true, a ``Zend\Validator\Explode`` validator will be added to ensure the input
87   string value is split by commas before validating each email address with ``Zend\Validator\Regex``.
88
105
106   Sets the email validator to use for multiple or single email addresses.
107
120.. _`HTML5 inputs with type email`: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-(type=email)
121.. _`HTML5 valid email address`: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
122
validation.py https://github.com/lukasgraf/tw2.core.git | Python | 605 lines
452
453class RegexValidator(Validator):
454    """
471
472class EmailValidator(RegexValidator):
473    """
473    """
474    Confirm the value is a valid email address.
475    """
476    msgs = {
477        'badregex': ('bademail', _('Must be a valid email address')),
478    }
505    msgs = {
506        'badipaddress': _('Must be a valid IP address'),
507        'badnetblock': _('Must be a valid IP network block'),
zend.form.element.email.rst https://github.com/arthead/zf2-documentation.git | Unknown | 95 lines
7type email`_. This element adds filters and validators to it's input filter specification in order to validate
8`HTML5 valid email address`_ on the server.
9
25   // Single email address
26   $email = new Element\Email('email');
27   $email->setLabel('Email Address')
30   // Comma separated list of emails
31   $emails = new Element\Email('emails');
32   $emails
86   If the ``multiple`` attribute is true, a ``Zend\Validator\Explode`` validator will be added to ensure the input
87   string value is split by commas before validating each email address with ``Zend\Validator\Regex``.
88
93.. _`HTML5 inputs with type email`: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-(type=email)
94.. _`HTML5 valid email address`: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
95
Email.cs https://github.com/s6admin/uComponents.git | C# | 60 lines
9	/// <summary>
10	/// The Email class exposes XSLT extensions to offer extended email functionality.
11	/// </summary>
21		/// </returns>
22		/// <remarks>http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx</remarks>
23		public static bool IsValidEmail(string input)
25			var pattern = @"^(?!\.)(""([^""\r\\]|\\[""\r\\])*""|([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?<!\.)\.)*)(?<!\.)@[a-z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$";
26			var regex = new Regex(pattern, RegexOptions.IgnoreCase);
27			return regex.IsMatch(input);
33		/// <param name="from">The 'from' email address.</param>
34		/// <param name="to">The 'to' email address.</param>
35		/// <param name="subject">The subject of the email.</param>
55			{
56				LogHelper.Error(typeof(Email), "uComponents.XsltExtensions.Email.SendMail: Error sending mail.", ex);
57			}
Address.pm https://github.com/gitpan/Email-Address.git | Perl | 851 lines
13#pod
14#pod   my @addresses = Email::Address->parse($line);
15#pod   my $address   = Email::Address->new(Casey => 'casey@localhost');
492#pod
493#pod   print "I have your email address, $address.";
494#pod
554This class implements a regex-based RFC 2822 parser that locates email
555addresses in strings and returns a list of C<Email::Address> objects found.
556Alternatively you may construct objects manually. The goal of this software is
825#pod   $ perl -Ilib bench/ea-vs-ma.pl bench/corpus.txt 5
826#pod                    Rate  Mail::Address Email::Address
827#pod   Mail::Address  2.59/s             --           -44%
835#pod   $ perl -Ilib bench/ea-vs-ma.pl bench/corpus.txt 50
836#pod                    Rate  Mail::Address Email::Address
837#pod   Mail::Address  2.57/s             --           -70%
2010-10-17-npes-3.bxm https://github.com/Altreus/podcats.git | Unknown | 291 lines
36job.[/fn], including the [c]\d[/c] shortcut for "a digit". Because this is grep,
37we return every line for which this regex gives a "yes" response. The regex is
38asking for "a digit". Grep obliges by showing us which lines have at least one
156
157This works fine for many email addresses, including ones with a plus in them,
158which is becoming more and more common these days because Google Mail uses it
163
164The list of problems with this regex is extensive, because the RFC on email
165addresses is nightmarish.
167regex you need in order to validate an email address correctly. If you don't use
168it, your email address regex will certainly come up with false negatives[fn]At a
169previous job, we had an issue where we took details from another company. One
169previous job, we had an issue where we took details from another company. One
170woman's email address was, fairly, her name, but her name had an apostrophe in
171it, being French or so. Anyway, the email validator would not accept the
Address.pm git://github.com/justingit/dada-mail.git | Perl | 912 lines
25#pod someday this will be fixed.  Until then, use
26#pod L<B<Email::Address::XS>|Email::Address::XS> instead which has backward
27#pod compatible API.
166#pod
167#pod Use method L<parse from the Email::Address::XS module|Email::Address::XS/parse>
168#pod instead.
504#pod
505#pod   print "I have your email address, $address.";
506#pod
570someday this will be fixed.  Until then, use
571L<B<Email::Address::XS>|Email::Address::XS> instead which has backward
572compatible API.
636
637Use method L<parse from the Email::Address::XS module|Email::Address::XS/parse>
638instead.
validators.py https://bitbucket.org/schlamar/gbottle-wiki | Python | 2,726 lines
815        >>> IS_EMAIL()('abc+def.com')        # no @
816        ('abc+def.com', 'enter a valid email address')
817        >>> IS_EMAIL()('abc@def.x')          # one-char TLD
827        >>> IS_EMAIL()('NotAnEmail')         # missing @
828        ('NotAnEmail', 'enter a valid email address')
829        >>> IS_EMAIL()('abc@NotAnEmail')     # missing TLD
829        >>> IS_EMAIL()('abc@NotAnEmail')     # missing TLD
830        ('abc@NotAnEmail', 'enter a valid email address')
831        >>> IS_EMAIL()('customer/department@example.com')
2566
2567    IPv4 regex taken from: http://regexlib.com/REDetails.aspx?regexp_id=1411
2568
2578                  None (default): indifferent
2579                  True (enforce): query address must match localhost address
2580                                  (127.0.0.1)
Email.php https://github.com/svn2github/efront-lms.git | PHP | 73 lines
4/**
5 * Email validation rule
6 * 
42    /**
43     * Validates an email address
44     *
44     *
45     * @param     string    $email          Email address
46     * @param     boolean   $checkDomain    True if dns check should be performed
52        // Fix for bug #10799: add 'D' modifier to regex
53        if (preg_match($this->regex . 'D', $email)) {
54            if ($checkDomain && function_exists('checkdnsrr')) {
68    {
69        return array("  var regex = " . $this->regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})");
70    } // end func getValidationScript
example_regex.txt https://github.com/austinsprawls/js-jquery-missing-manual.git | text | 25 lines
1US Zip Code REGEX
2var ZipCode = /\d{5}(-\d{4})?/;
5
6US Phone Number REGEX
7var phoneNum = /\(?(\d{3})\)?[ -.](\d{3})[ -.](\d{4})/;
10
11Email Address REGEX
12var email = /[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}/;
12var email = /[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}/;
13if you want to make sure the string ONLY contains an email address use the ^ and $ to match the beginning and ending of the string like this:
14var email = /^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$/;
15
16Date REGEX
17var date = /([01]?\d)[-\/ .]([0123]?\d)[-\/ .](\d{4})/;
20
21URL REGEX
22var URL = /((\bhttps?:\/\/)|(\bwww\.))\S*/;
Address.java https://github.com/chamatea0421/android_packages_apps_Email.git | Java | 475 lines
152                    }
153                    addresses.add(new Address(address, name));
154                }
187            // Leave unchanged for now (i.e. case-sensitive).
188            return getAddress().equals(((Address) o).getAddress());
189        }
347        }
348        ArrayList<Address> addresses = new ArrayList<Address>();
349        int length = addressList.length();
370            } else {
371                address = new Address(addressList.substring(pairStartIndex, addressEndIndex),
372                                      addressList.substring(addressEndIndex + 1, pairEndIndex));
468            }
469            addresses.add(new Address(address, personal));
470            pairStartIndex = pairEndIndex + 1;
Address.java https://github.com/Savaged-Zen/platform_packages_apps_email.git | Java | 509 lines
189            // Leave unchanged for now (i.e. case-sensitive).
190            return getAddress().equals(((Address) o).getAddress());
191        }
350        }
351        ArrayList<Address> addresses = new ArrayList<Address>();
352        int length = addressList.length();
373            } else {
374                address = new Address(addressList.substring(pairStartIndex, addressEndIndex),
375                                      addressList.substring(addressEndIndex + 1, pairEndIndex));
448        }
449        ArrayList<Address> addresses = new ArrayList<Address>();
450        int length = addressList.length();
490        for (int i = 0, count = addresses.length; i < count; i++) {
491            Address address = addresses[i];
492            try {
Changelog.txt https://github.com/nevaenuf/FluentValidation.git | text | 256 lines
35.3 - 27/05/2014
4* Fix issue https://fluentvalidation.codeplex.com/workitem/7183 (email address validation)
5
75* Implement client-side support for Equal with cross-property validation.
76* Implement client-side support for email validator.
77* Added credit card validator (plus client side support)
192* French resource translations.
193* EmailValidator now uses regex from http://hexillion.com/samples/#Regex
194
2151.1 beta 1 - May 26 2009
216* Validators can now be chained together: RuleFor(person => person.Address).SetValidator(new AddressValidator());
217* Marked the 'And' property as obsolete. It is now possible to chain validators without it. This will be removed in the next release.
230* Fixed issue with AddToModelState - SetModelValue should be called to ensure ASP.NET MVC's built-in HTML Helpers do not throw NullReferenceExceptions.
231* Fixed issue with email address regex - plus character should be allowed.
232* Fixed issue in Silverlight project - the Resource files were in the wrong namespace.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21