PageRenderTime 3155ms queryTime 435ms sortTime 2ms getByIdsTime 839ms findMatchingLines 552ms

100+ results results for 'email regex lang:python' (3155 ms)

Not the results you expected?
completions.py https://gitlab.com/vectorci/gitsome | Python | 330 lines
                    
58    },
                    
59    'emails': {
                    
60        'desc': "Lists all the user's registered emails.",
                    
310    '10': 'limit: int (opt) limits the posts displayed',
                    
311    '"(?i)(Python|Django)"': ('regex_query: string (opt) applies a regular '
                    
312                              'expression comment filter'),
                    
                
http.py https://gitlab.com/briankiragu/django | Python | 376 lines
                    
9from binascii import Error as BinasciiError
                    
10from email.utils import formatdate
                    
11
                    
134    """
                    
135    # emails.Util.parsedate does the job for RFC1123 dates; unfortunately
                    
136    # RFC7231 makes it mandatory to support RFC850 dates too. So we roll
                    
137    # our own RFC-compliant parsing.
                    
138    for regex in RFC1123_DATE, RFC850_DATE, ASCTIME_DATE:
                    
139        m = regex.match(date)
                    
                
forms.py https://github.com/chengwang/kitsune.git | Python | 195 lines
                    
49                        'max_length': USERNAME_LONG})
                    
50    email = forms.EmailField(label=_lazy(u'Email address:'),
                    
51                             error_messages={'required': EMAIL_REQUIRED,
                    
80        email = self.cleaned_data['email']
                    
81        if User.objects.filter(email=email).exists():
                    
82            raise forms.ValidationError(_('A user with that email address '
                    
178    """A simple form that requires an email address."""
                    
179    email = forms.EmailField(label=_lazy(u'Email address:'))
                    
180
                    
184    not the current user's email."""
                    
185    email = forms.EmailField(label=_lazy(u'Email address:'))
                    
186
                    
191    def clean_email(self):
                    
192        if self.user.email == self.cleaned_data['email']:
                    
193            raise forms.ValidationError(_('This is your current email.'))
                    
                
find_domain_arch.py https://github.com/ntamas/gfam.git | Python | 295 lines
                    
17__author__  = "Tamas Nepusz"
                    
18__email__   = "tamas@cs.rhul.ac.uk"
                    
19__copyright__ = "Copyright (c) 2010, Tamas Nepusz"
                    
70                default=None)
                    
71        parser.add_option("-r", "--seq-id-regexp", metavar="REGEXP",
                    
72                help="remap sequence IDs using REGEXP",
                    
72                help="remap sequence IDs using REGEXP",
                    
73                config_key="sequence_id_regexp",
                    
74                dest="sequence_id_regexp")
                    
205        unassigned_app = FindUnassignedApp()
                    
206        unassigned_app.set_sequence_id_regexp(self.options.sequence_id_regexp)
                    
207        unassigned_app.process_sequences_file(self.options.sequences_file)
                    
                
pages.py https://github.com/laurentb/weboob.git | Python | 207 lines
                    
27from weboob.browser.elements import ListElement, ItemElement, method
                    
28from weboob.browser.filters.standard import CleanText, Format, Regexp, Env, DateTime, Filter
                    
29from weboob.browser.filters.html import Link, Attr
                    
69            form = self.get_form(xpath='//form[@action="https://twitter.com/sessions"]')
                    
70            form['session[username_or_email]'] = login
                    
71            form['session[password]'] = passwd
                    
85    def get_me(self):
                    
86        return Regexp(Link('//a[@data-nav="view_profile"]'), '/(.+)')(self.doc)
                    
87
                    
100                                     replace=[('@ ', '@'), ('# ', '#'), ('http:// ', 'http://')]))
                    
101        obj_date = DateTime(Regexp(CleanText('//div[has-class("permalink-inner permalink-tweet-container")]/div/div/div[@class="client-and-actions"]/span/span'),
                    
102                                   '(\d+:\d+).+- (.+\d{4})',
                    
111
                    
112            obj_id = Regexp(Link('./div/div/small/a', default=''), '/.+/status/(.+)', default=None)
                    
113
                    
                
diffcommit.py https://github.com/reviewboard/reviewboard.git | Python | 393 lines
                    
41    uri_object_key = 'commit_id'
                    
42    uri_object_key_regex = r'[A-Za-z0-9]{1,%s}' % COMMIT_ID_LENGTH
                    
43
                    
65        },
                    
66        'author_email': {
                    
67            'type': StringFieldType,
                    
83        },
                    
84        'committer_email': {
                    
85            'type': StringFieldType,
                    
                
app.py https://github.com/dimagi/aremind.git | Python | 242 lines
                    
32
                    
33def daily_email_callback(router, *args, **kwargs):
                    
34    """
                    
34    """
                    
35    Send out daily email report of confirmed/unconfirmed appointments.
                    
36    """
                    
54        subject = subject_template.format(**context)
                    
55        body = render_to_string('reminders/emails/daily_report_message.html', context)
                    
56        group_name = settings.DEFAULT_DAILY_REPORT_GROUP_NAME
                    
58        if not created:
                    
59            emails = [c.email for c in group.contacts.all() if c.email]
                    
60            if emails:
                    
60            if emails:
                    
61                send_mail(subject, body, None, emails, fail_silently=True)
                    
62
                    
                
forms.py https://github.com/aruder77/applause.git | Python | 214 lines
                    
13    """
                    
14    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
15        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
47class UserChangeForm(forms.ModelForm):
                    
48    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
49        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
106class PasswordResetForm(forms.Form):
                    
107    email = forms.EmailField(label=_("E-mail"), max_length=75)
                    
108
                    
112        """
                    
113        email = self.cleaned_data["email"]
                    
114        self.users_cache = User.objects.filter(email__iexact=email)
                    
118
                    
119    def save(self, domain_override=None, email_template_name='registration/password_reset_email.html',
                    
120             use_https=False, token_generator=default_token_generator, from_email=None, request=None):
                    
                
__init__.py https://github.com/ceberhardt/surf.git | Python | 403 lines
                    
5# author: Cosmin Basca
                    
6# email: cosmin.basca@gmail.com
                    
7
                    
85    @classmethod
                    
86    def regex(cls, var, pattern, flag = None):
                    
87        if type(var) in [str, unicode] and var.startswith('?'): pass
                    
100
                    
101        return Filter('regex(%s,"%s"%s)' % (var, pattern, ',"%s"' % flag))
                    
102
                    
                
deploy.py https://gitlab.com/gregtyka/server | Python | 283 lines
                    
71    else:
                    
72        email = raw_input("App Engine Email: ")
                    
73        password = getpass.getpass("Password for %s: " % email)
                    
73        password = getpass.getpass("Password for %s: " % email)
                    
74        return (email, password)
                    
75
                    
121    # to verify deploy is being sent from correct directory.
                    
122    regex = re.compile("^facebook_app_secret = '4362.+'$", re.MULTILINE)
                    
123    return regex.search(content)
                    
163
                    
164def deploy(version, email, password):
                    
165    print "Deploying version " + str(version)
                    
165    print "Deploying version " + str(version)
                    
166    return 0 == popen_return_code(['appcfg.py', '-V', str(version), "--no_oauth2", "-e", email, "--passin", "update", "."], "%s\n" % password)
                    
167
                    
                
scrub.py https://gitlab.com/mailman/django-mailman3 | Python | 284 lines
                    
22from email.header import decode_header, make_header
                    
23from email.message import EmailMessage
                    
24from enum import Enum
                    
32SRE = re.compile(r'[^-\w.]')
                    
33# Regexp to strip out leading dots
                    
34DRE = re.compile(r'^\.*')
                    
58    """
                    
59    Given an EmailMessage, extract all the attachments including text/html
                    
60    parts and return the text.
                    
65    def __init__(self, msg):
                    
66        assert isinstance(msg, EmailMessage)
                    
67        self.msg = msg
                    
69    def scrub(self):
                    
70        """Given a EmailMessage, extracts the text from the body and all the
                    
71        attachments.
                    
                
forms.py https://github.com/ron-panduwana/test_gae.git | Python | 131 lines
                    
20    domain = forms.RegexField(
                    
21        required=True, regex=regexps.RE_DOMAIN, label='www.',
                    
22        error_messages={'invalid': regexps.ERROR_DOMAIN})
                    
76    account = forms.RegexField(
                    
77        regex=regexps.RE_USERNAME, label=_('Administrator account'),
                    
78        error_messages={'invalid': regexps.ERROR_USERNAME})
                    
101            old_credentials = {
                    
102                'email': apps_domain.admin_email,
                    
103                'password': apps_domain.admin_password,
                    
107            if old_credentials:
                    
108                apps_domain.admin_email = old_credentials['email']
                    
109                apps_domain.admin_password = old_credentials['password']
                    
113            domain, self.service.service))
                    
114        apps_domain.admin_email = email
                    
115        apps_domain.admin_password = password
                    
                
__init__.py https://bitbucket.org/jspatrick/emacs.git | Python | 451 lines
                    
135In order to hone the accuracy of the translation of global variables, you will find two dictionary parameters below --
                    
136`global_var_include_regex` and `global_var_exclude_regex` -- which you can use to set a regular expression string
                    
137to tell the translator which global variables to share with the mel environment (i.e. which will use the get and set
                    
177are many more that i need to fix.  you'll know you hit the problem when you get this error: 'TypeError: iteration
                    
178over non-sequence'. just email me with commands that are giving you problems and i'll fix them as
                    
179quickly as i can.
                    
                
test_membership.py https://gitlab.com/sk7089775/mailman | Python | 274 lines
                    
101                          system_preferences.preferred_language))
                    
102        self.assertEqual(member.address.email, 'anne@example.com')
                    
103
                    
192        # mixed case address can't be subscribed.
                    
193        email = 'APerson@example.com'
                    
194        add_member(
                    
195            self._mlist,
                    
196            RequestRecord(email.lower(), 'Ann Person',
                    
197                          DeliveryMode.regular,
                    
204                              system_preferences.preferred_language))
                    
205        self.assertEqual(cm.exception.email, email)
                    
206
                    
222                              system_preferences.preferred_language))
                    
223        self.assertEqual(cm.exception.email, email.lower())
                    
224
                    
                
tests.py https://code.google.com/p/pageforest/ | Python | 324 lines
                    
18
                    
19TAG_REGEX = re.compile(r'<[/!\w][^>]*>')
                    
20
                    
43
                    
44    Users: peter, paul (not email verified)
                    
45    Apps: www, myapp
                    
60        self.peter = User(key_name='peter', username='Peter',
                    
61                          email='peter@example.com',
                    
62                          email_verified=datetime.datetime.now())
                    
65        self.paul = User(key_name='paul', username='Paul',
                    
66                         email='paul@example.com')
                    
67        self.paul.set_password('paul_secret')
                    
141        """Extract the most meaningful parts from the response."""
                    
142        text = TAG_REGEX.sub(' ', response.content)
                    
143        lines = [line.strip() for line in text.splitlines() if line.strip()]
                    
                
__init__.py https://github.com/jchris/portable-google-app-engine-sdk.git | Python | 396 lines
                    
29  [('name', str),
                    
30   ('email', datastore_types.Email),
                    
31   ('birthdate', lambda x: datetime.datetime.fromtimestamp(float(x))),
                    
40  urlmap:
                    
41  - regex: /load
                    
42    handler:
                    
177         ('id_number', int),
                    
178         ('email', datastore_types.Email),
                    
179         ('user', users.User),
                    
                
0015_auto__del_repo__del_field_package_repo.py https://github.com/pythonchelle/opencomparison.git | Python | 143 lines
                    
21        db.create_table('package_repo', (
                    
22            ('slug_regex', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)),
                    
23            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
                    
25            ('handler', self.gf('django.db.models.fields.CharField')(default='package.handlers.unsupported', max_length='200')),
                    
26            ('repo_regex', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)),
                    
27            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
                    
32            ('is_supported', self.gf('django.db.models.fields.BooleanField')(default=False)),
                    
33            ('user_regex', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)),
                    
34            ('is_other', self.gf('django.db.models.fields.BooleanField')(default=False)),
                    
58            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
                    
59            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
                    
60            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
                    
                
mail_mail.py https://gitlab.com/padjis/mapan | Python | 106 lines
                    
8
                    
9from odoo.addons.link_tracker.models.link_tracker import URL_REGEX
                    
10
                    
38
                    
39    def _get_unsubscribe_url(self, email_to):
                    
40        base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
                    
46                    'res_id': self.res_id,
                    
47                    'email': email_to,
                    
48                    'token': self.mailing_id._unsubscribe_token(
                    
48                    'token': self.mailing_id._unsubscribe_token(
                    
49                        self.res_id, email_to),
                    
50                }),
                    
88        if self.mailing_id and res.get('body') and res.get('email_to'):
                    
89            emails = tools.email_split(res.get('email_to')[0])
                    
90            email_to = emails and emails[0] or False
                    
                
forms.py https://bitbucket.org/xtchenhui/horizon-zte.git | Python | 196 lines
                    
62    name = forms.CharField(label=_("User Name"))
                    
63    email = forms.EmailField(label=_("Email"))
                    
64    password = forms.RegexField(
                    
66            widget=forms.PasswordInput(render_value=False),
                    
67            regex=validators.password_validator(),
                    
68            error_messages={'invalid': validators.password_validator_msg()})
                    
90                                                data['name'],
                    
91                                                data['email'],
                    
92                                                data['password'],
                    
115    name = forms.CharField(label=_("User Name"))
                    
116    email = forms.EmailField(label=_("Email"))
                    
117    password = forms.RegexField(label=_("Password"),
                    
118            widget=forms.PasswordInput(render_value=False),
                    
119            regex=validators.password_validator(),
                    
120            required=False,
                    
                
command.py https://gitlab.com/noc0lour/mailman | Python | 234 lines
                    
20# See the delivery diagram in IncomingRunner.py.  This module handles all
                    
21# email destined for mylist-request, -join, and -leave.  It no longer handles
                    
22# bounce messages (i.e. -admin or -bounces), nor does it handle mail to
                    
28from contextlib import suppress
                    
29from email.errors import HeaderParseError
                    
30from email.header import decode_header, make_header
                    
30from email.header import decode_header, make_header
                    
31from email.iterators import typed_subpart_iterator
                    
32from io import StringIO
                    
36from mailman.core.runner import Runner
                    
37from mailman.email.message import UserNotification
                    
38from mailman.interfaces.command import ContinueProcessing, IEmailResults
                    
64        elif subaddress == 'confirm':
                    
65            mo = re.match(config.mta.verp_confirm_regexp, msg.get('to', ''))
                    
66            if mo:
                    
                
forms.py https://bitbucket.org/Squazic/youwastetime.git | Python | 218 lines
                    
13    """
                    
14    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
15        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
47class UserChangeForm(forms.ModelForm):
                    
48    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
49        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
107class PasswordResetForm(forms.Form):
                    
108    email = forms.EmailField(label=_("E-mail"), max_length=75)
                    
109
                    
113        """
                    
114        email = self.cleaned_data["email"]
                    
115        self.users_cache = User.objects.filter(
                    
115        self.users_cache = User.objects.filter(
                    
116                                email__iexact=email,
                    
117                                is_active=True
                    
                
test_db.py https://gitlab.com/unofficial-mirrors/edx-platform | Python | 239 lines
                    
68                    try:
                    
69                        User.objects.get(username='student', email='student@edx.org')
                    
70                    except User.DoesNotExist:
                    
77
                    
78                    __, created = User.objects.get_or_create(username='student', email='student@edx.org')
                    
79                except Exception as exception:  # pylint: disable=broad-except
                    
113
                    
114        with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
                    
115            with atomic():
                    
117
                    
118        with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
                    
119            with outer_atomic():
                    
134
                    
135        with self.assertRaisesRegexp(TransactionManagementError, 'Cannot change isolation level when nested.'):
                    
136            with commit_on_success():
                    
                
test_error_messages.py https://gitlab.com/asmjahid/django | Python | 274 lines
                    
6    BooleanField, CharField, ChoiceField, DateField, DateTimeField,
                    
7    DecimalField, EmailField, FileField, FloatField, Form,
                    
8    GenericIPAddressField, IntegerField, ModelChoiceField,
                    
8    GenericIPAddressField, IntegerField, ModelChoiceField,
                    
9    ModelMultipleChoiceField, MultipleChoiceField, RegexField,
                    
10    SplitDateTimeField, TimeField, URLField, ValidationError, utils,
                    
111
                    
112    def test_regexfield(self):
                    
113        e = {
                    
118        }
                    
119        f = RegexField(r'^[0-9]+$', min_length=5, max_length=10, error_messages=e)
                    
120        self.assertFormErrors(['REQUIRED'], f.clean, '')
                    
124
                    
125    def test_emailfield(self):
                    
126        e = {
                    
                
sync_media_s3.py https://github.com/mpdaugherty/django-extensions.git | Python | 282 lines
                    
35TODO:
                    
36 * Use fnmatch (or regex) to allow more complex FILTER_LIST rules.
                    
37
                    
39import datetime
                    
40import email
                    
41import mimetypes
                    
252                # HTTP/1.0
                    
253                headers['Expires'] = '%s GMT' % (email.Utils.formatdate(
                    
254                    time.mktime((datetime.datetime.now() +
                    
                
common.py https://gitlab.com/adam.lukaitis/muzei | Python | 397 lines
                    
31import datetime
                    
32from email import utils as email_utils
                    
33import logging
                    
43_GCS_BUCKET_REGEX_BASE = r'[a-z0-9\.\-_]{3,63}'
                    
44_GCS_BUCKET_REGEX = re.compile(_GCS_BUCKET_REGEX_BASE + r'$')
                    
45_GCS_BUCKET_PATH_REGEX = re.compile(r'/' + _GCS_BUCKET_REGEX_BASE + r'$')
                    
45_GCS_BUCKET_PATH_REGEX = re.compile(r'/' + _GCS_BUCKET_REGEX_BASE + r'$')
                    
46_GCS_PATH_PREFIX_REGEX = re.compile(r'/' + _GCS_BUCKET_REGEX_BASE + r'.*')
                    
47_GCS_FULLPATH_REGEX = re.compile(r'/' + _GCS_BUCKET_REGEX_BASE + r'/.*')
                    
178  _validate_path(name)
                    
179  if not _GCS_BUCKET_REGEX.match(name):
                    
180    raise ValueError('Bucket should be 3-63 characters long using only a-z,'
                    
295  if http_time is not None:
                    
296    return email_utils.mktime_tz(email_utils.parsedate_tz(http_time))
                    
297
                    
                
forms.py https://bitbucket.org/andrewlvov/django-registration-custom.git | Python | 120 lines
                    
31    
                    
32    username = forms.RegexField(regex=r'^[\w.@+-]+$',
                    
33                                max_length=30,
                    
35                                error_messages={'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
                    
36    email = forms.EmailField(label=_("E-mail"))
                    
37    password1 = forms.CharField(widget=forms.PasswordInput,
                    
90        """
                    
91        if User.objects.filter(email__iexact=self.cleaned_data['email']):
                    
92            raise forms.ValidationError(_("This email address is already in use. Please supply a different email address."))
                    
116        """
                    
117        email_domain = self.cleaned_data['email'].split('@')[1]
                    
118        if email_domain in self.bad_domains:
                    
118        if email_domain in self.bad_domains:
                    
119            raise forms.ValidationError(_("Registration using free email addresses is prohibited. Please supply a different email address."))
                    
120        return self.cleaned_data['email']
                    
                
views.py https://github.com/eric-brechemier/django.git | Python | 191 lines
                    
38            # not be allowed, but things like /view/?param=http://example.com 
                    
39            # should be allowed. This regex checks if there is a '//' *before* a
                    
40            # question mark.
                    
105def password_reset(request, is_admin_site=False, template_name='registration/password_reset_form.html',
                    
106        email_template_name='registration/password_reset_email.html',
                    
107        password_reset_form=PasswordResetForm, token_generator=default_token_generator,
                    
107        password_reset_form=PasswordResetForm, token_generator=default_token_generator,
                    
108        post_reset_redirect=None, from_email=None):
                    
109    if post_reset_redirect is None:
                    
116            opts['token_generator'] = token_generator
                    
117            opts['from_email'] = from_email
                    
118            if is_admin_site:
                    
120            else:
                    
121                opts['email_template_name'] = email_template_name
                    
122                if not Site._meta.installed:
                    
                
validators.py https://bitbucket.org/ssaltzman/poet.git | Python | 190 lines
                    
25        if regex is not None:
                    
26            self.regex = regex
                    
27        if message is not None:
                    
32        if isinstance(self.regex, basestring):
                    
33            self.regex = re.compile(regex)
                    
34
                    
45
                    
46class URLValidator(RegexValidator):
                    
47    regex = re.compile(
                    
115
                    
116class EmailValidator(RegexValidator):
                    
117
                    
137    r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?$', re.IGNORECASE)  # domain
                    
138validate_email = EmailValidator(email_re, _(u'Enter a valid e-mail address.'), 'invalid')
                    
139
                    
                
admin.py https://github.com/pombredanne/django-sentry.git | Python | 344 lines
                    
132    list_filter = ("auth_provider__provider",)
                    
133    search_fields = ("user__email", "user__username", "auth_provider__organization__name")
                    
134    raw_id_fields = ("user", "auth_provider")
                    
161class UserChangeForm(UserChangeForm):
                    
162    username = forms.RegexField(
                    
163        label=_("Username"),
                    
164        max_length=128,
                    
165        regex=r"^[\w.@+-]+$",
                    
166        help_text=_("Required. 128 characters or fewer. Letters, digits and " "@/./+/-/_ only."),
                    
175class UserCreationForm(UserCreationForm):
                    
176    username = forms.RegexField(
                    
177        label=_("Username"),
                    
178        max_length=128,
                    
179        regex=r"^[\w.@+-]+$",
                    
180        help_text=_("Required. 128 characters or fewer. Letters, digits and " "@/./+/-/_ only."),
                    
                
_encoded_words.py https://github.com/albertz/CPython.git | Python | 233 lines
                    
46from string import ascii_letters, digits
                    
47from email import errors
                    
48
                    
62
                    
63# regex based decoder.
                    
64_q_byte_subber = functools.partial(re.compile(br'=([a-fA-F0-9]{2})').sub,
                    
                
models.py https://github.com/kd7lxl/memrec.git | Python | 149 lines
                    
1from django.db import models
                    
2from django.core.validators import RegexValidator
                    
3
                    
7phone_re = re.compile(r'^[\d]{10}$')
                    
8validate_phone = RegexValidator(phone_re, (u"Enter a 10-digit phone number with no punctuation."), 'invalid')
                    
9
                    
10hostname_re = re.compile(r'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$')
                    
11validate_hostname = RegexValidator(hostname_re, (u"Enter a valid hostname."), 'invalid')
                    
12
                    
91
                    
92class EmailAddress(models.Model):
                    
93    person = models.ForeignKey(Person)
                    
93    person = models.ForeignKey(Person)
                    
94    email_address = models.EmailField()
                    
95    
                    
                
inlinepatterns.py https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Python | 371 lines
                    
9
                    
10    pattern.getCompiledRegExp() # returns a regular expression
                    
11
                    
135
                    
136    def getCompiledRegExp (self):
                    
137        """ Return a compiled regular expression. """
                    
350        el = markdown.etree.Element('a')
                    
351        email = m.group(2)
                    
352        if email.startswith("mailto:"):
                    
352        if email.startswith("mailto:"):
                    
353            email = email[len("mailto:"):]
                    
354
                    
362
                    
363        letters = [codepoint2name(ord(letter)) for letter in email]
                    
364        el.text = markdown.AtomicString(''.join(letters))
                    
                
__init__.py https://github.com/rtnpro/askbot-devel.git | Python | 393 lines
                    
82            body_text = None,
                    
83            from_email = django_settings.DEFAULT_FROM_EMAIL,
                    
84            recipient_list = None,
                    
335        if form.is_valid():
                    
336            email_address = form.cleaned_data['email']
                    
337            user = User.objects.get(
                    
337            user = User.objects.get(
                    
338                        email__iexact = email_address
                    
339                    )
                    
375    except User.DoesNotExist:
                    
376        bounce_email(email_address, subject, reason = 'unknown_user')
                    
377    except User.MultipleObjectsReturned:
                    
377    except User.MultipleObjectsReturned:
                    
378        bounce_email(email_address, subject, reason = 'problem_posting')
                    
379    except PermissionDenied, error:
                    
                
__init__.py https://gitlab.com/gregtyka/server | Python | 226 lines
                    
19
                    
20from wtforms.validators import Email, email, EqualTo, equal_to, \
                    
21    IPAddress, ip_address, Length, length, NumberRange, number_range, \
                    
21    IPAddress, ip_address, Length, length, NumberRange, number_range, \
                    
22    Optional, optional, Required, required, Regexp, regexp, \
                    
23    URL, url, AnyOf, any_of, NoneOf, none_of
                    
                
widgets.py https://github.com/socialplanning/opencore-listen.git | Python | 309 lines
                    
11from Products.CMFPlone.utils import getSiteEncoding
                    
12from Products.listen.lib.common import email_regex
                    
13
                    
250    """A version of the removal widget that will accept entries that may be
                    
251      simple email addresses and not exclusively member ids.
                    
252
                    
267
                    
268    But, if we add a simple email address::
                    
269        >>> widget.setRenderedValue((u'test1','tester@example.com'))
                    
286                info = None
                    
287            if info is None and email_regex.match(entry):
                    
288                info = {'id': entry, 'name': entry, 'fullname': '',
                    
                
lecturio.py https://gitlab.com/vitalii.dr/yt-dlp | Python | 236 lines
                    
37        login_form = {
                    
38            'signin[email]': username,
                    
39            'signin[password]': password,
                    
50
                    
51        errors = self._html_search_regex(
                    
52            r'(?s)<ul[^>]+class=["\']error_list[^>]+>(.+?)</ul>', response,
                    
152            cc_label = cc.get('translatedCode')
                    
153            lang = cc.get('languageCode') or self._search_regex(
                    
154                r'/([a-z]{2})_', cc_url, 'lang',
                    
155                default=cc_label.split()[0] if cc_label else 'en')
                    
156            original_lang = self._search_regex(
                    
157                r'/[a-z]{2}_([a-z]{2})_', cc_url, 'original lang',
                    
232
                    
233        title = self._search_regex(
                    
234            r'<h1[^>]*>([^<]+)', webpage, 'title', default=None)
                    
                
utils.py https://gitlab.com/mstolarczyk/master_thesis | Python | 372 lines
                    
3__copyright__ = "Copyright 2015, Johannes Köster"
                    
4__email__ = "koester@jimmy.harvard.edu"
                    
5__license__ = "MIT"
                    
18
                    
19from snakemake.io import regex, Namedlist, Wildcards
                    
20from snakemake.logging import logger
                    
64        dirname = os.path.dirname(pattern)
                    
65    pattern = re.compile(regex(pattern))
                    
66    for dirpath, dirnames, filenames in os.walk(dirname):
                    
131        template (str):     An optional path to a docutils HTML template.
                    
132        metadata (str):     E.g. an optional author name or email address.
                    
133
                    
                
register_and_share_1.py https://bitbucket.org/isanneh/smart-house-web-app-isatou.git | Python | 188 lines
                    
22        driver.find_element_by_id("last_name").send_keys("l")
                    
23        driver.find_element_by_id("email").clear()
                    
24        driver.find_element_by_id("email").send_keys("u1@gmail.com")
                    
36        driver.find_element_by_id("last_name").send_keys("l")
                    
37        driver.find_element_by_id("email").clear()
                    
38        driver.find_element_by_id("email").send_keys("u2@gmail.com")
                    
50        driver.find_element_by_id("last_name").send_keys("l")
                    
51        driver.find_element_by_id("email").clear()
                    
52        driver.find_element_by_id("email").send_keys("u3")
                    
58        driver.find_element_by_id("confirm_password").send_keys("test")
                    
59        driver.find_element_by_id("email").clear()
                    
60        driver.find_element_by_id("email").send_keys("u3@gmail.com")
                    
61        driver.find_element_by_css_selector("input.btn").click()
                    
62        driver.find_element_by_id("email").clear()
                    
63        driver.find_element_by_id("email").send_keys("u1@gmail.com")
                    
                
controller.py https://gitlab.com/e0/cachecontrol | Python | 353 lines
                    
7import time
                    
8from email.utils import parsedate_tz
                    
9
                    
21def parse_uri(uri):
                    
22    """Parses a URI using the regex given in Appendix B of RFC 3986.
                    
23
                    
                
operations.py git://github.com/django/django.git | Python | 288 lines
                    
94        if lookup_type in ('iexact', 'contains', 'icontains', 'startswith',
                    
95                           'istartswith', 'endswith', 'iendswith', 'regex', 'iregex'):
                    
96            if internal_type in ('IPAddressField', 'GenericIPAddressField'):
                    
97                lookup = "HOST(%s)"
                    
98            elif internal_type in ('CICharField', 'CIEmailField', 'CITextField'):
                    
99                lookup = '%s::citext'
                    
                
player_alert.py https://gitlab.com/rgorham1/fantasy-player-alert | Python | 237 lines
                    
42            sign_in.click()
                    
43            user_name = self.browser.find_element_by_name('email')
                    
44            pw = self.browser.find_element_by_name('password')
                    
137            news_container = player_news.find_elements_by_class_name('pb')
                    
138            # TODO: change keywords to regex expressions
                    
139            keywords = ['DFS', 'boost', 'usage', 'ruled', '(', ')']
                    
170    @staticmethod
                    
171    def email(message):
                    
172        key = 'key-01577a41c5abaf547dfcdf0bc021c1f7'
                    
186        response.raise_for_status()
                    
187        print 'email sent'
                    
188
                    
204        insight = self.get_news(fd_players, pages, analysis)
                    
205        # email(insight)
                    
206
                    
                
mail_global.py https://gitlab.com/yaojian/RenjuAI | Python | 295 lines
                    
15        self.__register_macro_define()
                    
16        self.__register_regex()
                    
17        self.__register_etc(etc_file)
                    
54
                    
55    def __register_regex(self):
                    
56        self.email_reg = re.compile('[^@|\s]+@[^@]+\.[^@|\s]+')
                    
56        self.email_reg = re.compile('[^@|\s]+@[^@]+\.[^@|\s]+')
                    
57        self.email_reg_2 = re.compile(u"[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-.]+)+")
                    
58        self.email_addr_ignore = re.compile(u'undisclosed-recipients|Mail Delivery Subsystem|Mail Delivery System',
                    
59                                            flags=re.IGNORECASE)
                    
60        self.email_html_br_tag = re.compile(u"<br.*?>|<p.*?>", flags=re.IGNORECASE | re.DOTALL)
                    
61        self.email_html_tag = re.compile(u'<style.*?style>|<script.*?script>|<.*?>|[\r\t]{2,}|&nbsp;', flags=re.IGNORECASE | re.DOTALL)
                    
66
                    
67        # time regex
                    
68        """
                    
                
scrub.py https://gitlab.com/mathuin/hyperkitty | Python | 311 lines
                    
26from mimetypes import guess_all_extensions
                    
27from email.header import decode_header, make_header
                    
28from email.errors import HeaderParseError
                    
34sre = re.compile(r'[^-\w.]')
                    
35# Regexp to strip out leading dots
                    
36dre = re.compile(r'^\.*')
                    
56    Get the message charset.
                    
57    From: http://ginstrom.com/scribbles/2007/11/19/parsing-multilingual-email-with-python/
                    
58    """
                    
93    attachments.
                    
94    See also: http://ginstrom.com/scribbles/2007/11/19/parsing-multilingual-email-with-python/
                    
95    """
                    
170                    ctype.decode("ascii")
                    
171                # XXX Under email 2.5, it is possible that payload will be None.
                    
172                # This can happen when you have a Content-Type: multipart/* with
                    
                
__init__.py https://github.com/sagarun/askbot-devel.git | Python | 304 lines
                    
88#however it will be hard to expect that people will type
                    
89#correct regexes - plus this must be an anchored regex
                    
90#to do full string match
                    
91TAG_CHARS = '\w\+\.\-#'
                    
92TAG_REGEX = r'^[%s]+$' % TAG_CHARS
                    
93TAG_SPLIT_REGEX = r'[ ,]+'
                    
93TAG_SPLIT_REGEX = r'[ ,]+'
                    
94EMAIL_REGEX = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b', re.I)
                    
95
                    
112TYPE_ACTIVITY_USER_FULL_UPDATED = 17
                    
113TYPE_ACTIVITY_EMAIL_UPDATE_SENT = 18
                    
114TYPE_ACTIVITY_MENTION = 19
                    
138    (TYPE_ACTIVITY_USER_FULL_UPDATED, _('completed user profile')),
                    
139    (TYPE_ACTIVITY_EMAIL_UPDATE_SENT, _('email update sent to user')),
                    
140    (
                    
                
views.py https://github.com/gorner/myewb2.git | Python | 207 lines
                    
17from account.utils import get_default_redirect
                    
18from emailconfirmation.models import EmailAddress, EmailConfirmation
                    
19from pinax.apps.account.forms import ResetPasswordKeyForm
                    
79@login_required
                    
80def email(request, form_class=AddEmailForm, template_name="account/email.html",
                    
81          username=None):
                    
109                        })
                    
110                    EmailConfirmation.objects.send_confirmation(email_address)
                    
111                except EmailAddress.DoesNotExist:
                    
113            elif request.POST["action"] == "remove":
                    
114                email = request.POST["email"]
                    
115                try:
                    
127            elif request.POST["action"] == "primary":
                    
128                email = request.POST["email"]
                    
129                email_address = EmailAddress.objects.get(
                    
                
validators.py https://github.com/sgammon/Young-Voter-Revolution.git | Python | 329 lines
                    
6    'Length', 'length', 'NumberRange', 'number_range', 'Optional', 'optional',
                    
7    'Required', 'required', 'Regexp', 'regexp', 'URL', 'url', 'AnyOf',
                    
8    'any_of', 'NoneOf', 'none_of'
                    
191        if isinstance(regex, basestring):
                    
192            regex = re.compile(regex, flags)
                    
193        self.regex = regex
                    
241    """
                    
242    Simple regexp based url validation. Much like the email validator, you
                    
243    probably want to validate the url later by other means if the url must
                    
318
                    
319email = Email
                    
320equal_to = EqualTo
                    
325required = Required
                    
326regexp = Regexp
                    
327url = URL
                    
                
common.py https://gitlab.com/llndhlov/journly | Python | 174 lines
                    
42        if user_agent is not None:
                    
43            for user_agent_regex in settings.DISALLOWED_USER_AGENTS:
                    
44                if user_agent_regex.search(user_agent):
                    
117
                    
118class BrokenLinkEmailsMiddleware(MiddlewareMixin):
                    
119
                    
120    def process_response(self, request, response):
                    
121        """Send broken link emails for relevant 404 NOT FOUND responses."""
                    
122        if response.status_code == 404 and not settings.DEBUG:
                    
                
error_messages.py https://github.com/postmates/django.git | Python | 264 lines
                    
103
                    
104    def test_regexfield(self):
                    
105        e = {
                    
110        }
                    
111        f = RegexField(r'^\d+$', min_length=5, max_length=10, error_messages=e)
                    
112        self.assertFormErrors([u'REQUIRED'], f.clean, '')
                    
116
                    
117    def test_emailfield(self):
                    
118        e = {
                    
123        }
                    
124        f = EmailField(min_length=8, max_length=10, error_messages=e)
                    
125        self.assertFormErrors([u'REQUIRED'], f.clean, '')
                    
                
command.py https://gitlab.com/aadityashukla1989/mailman | Python | 235 lines
                    
20# See the delivery diagram in IncomingRunner.py.  This module handles all
                    
21# email destined for mylist-request, -join, and -leave.  It no longer handles
                    
22# bounce messages (i.e. -admin or -bounces), nor does it handle mail to
                    
27
                    
28from email.errors import HeaderParseError
                    
29from email.header import decode_header, make_header
                    
29from email.header import decode_header, make_header
                    
30from email.iterators import typed_subpart_iterator
                    
31from io import StringIO
                    
35from mailman.core.runner import Runner
                    
36from mailman.email.message import UserNotification
                    
37from mailman.interfaces.command import ContinueProcessing, IEmailResults
                    
63        elif subaddress == 'confirm':
                    
64            mo = re.match(config.mta.verp_confirm_regexp, msg.get('to', ''))
                    
65            if mo:
                    
                
safari.py https://gitlab.com/angelbirth/youtube-dl | Python | 192 lines
                    
18    _LOGIN_URL = 'https://www.safaribooksonline.com/accounts/login/'
                    
19    _SUCCESSFUL_LOGIN_REGEX = r'<a href="/accounts/logout/"[^>]*>Sign Out</a>'
                    
20    _NETRC_MACHINE = 'safari'
                    
47
                    
48        csrf = self._html_search_regex(
                    
49            r"name='csrfmiddlewaretoken'\s+value='([^']+)'",
                    
53            'csrfmiddlewaretoken': csrf,
                    
54            'email': username,
                    
55            'password1': password,
                    
64
                    
65        if re.search(self._SUCCESSFUL_LOGIN_REGEX, login_page) is None:
                    
66            raise ExtractorError(
                    
104        webpage = self._download_webpage(url, video_id)
                    
105        reference_id = self._search_regex(
                    
106            r'data-reference-id=(["\'])(?P<id>(?:(?!\1).)+)\1',
                    
                
test_helpers.py https://gitlab.com/EnLab/zulip | Python | 350 lines
                    
229        if email not in API_KEYS:
                    
230            API_KEYS[email] =  get_user_profile_by_email(email).api_key
                    
231        return API_KEYS[email]
                    
242        """
                    
243        user_profile = get_user_profile_by_email(email)
                    
244        subs = Subscription.objects.filter(
                    
323    def subscribe_to_stream(self, email, stream_name, realm=None):
                    
324        realm = Realm.objects.get(domain=resolve_email_to_domain(email))
                    
325        stream, _ = create_stream_if_needed(realm, stream_name)
                    
325        stream, _ = create_stream_if_needed(realm, stream_name)
                    
326        user_profile = get_user_profile_by_email(email)
                    
327        do_add_subscription(user_profile, stream, no_log=True)
                    
345        msg = Message.objects.filter().order_by('-id')[0]
                    
346        self.assertEqual(msg.sender.email, email)
                    
347        self.assertEqual(get_display_recipient(msg.recipient), stream_name)
                    
                
0001_initial.py https://gitlab.com/alfadil/alfadilhasdidit | Python | 53 lines
                    
42                ('Address', models.TextField()),
                    
43                ('Phone1', models.CharField(blank=True, max_length=9, validators=[django.core.validators.RegexValidator(message=b"Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex=b'^\\+?1?\\d{9,15}$')])),
                    
44                ('Phone2', models.CharField(blank=True, max_length=9, validators=[django.core.validators.RegexValidator(message=b"Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex=b'^\\+?1?\\d{9,15}$')])),
                    
44                ('Phone2', models.CharField(blank=True, max_length=9, validators=[django.core.validators.RegexValidator(message=b"Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex=b'^\\+?1?\\d{9,15}$')])),
                    
45                ('email', models.CharField(max_length=140)),
                    
46            ],
                    
                
scrub.py https://gitlab.com/thelinuxguy/django-mailman3 | Python | 277 lines
                    
29from mimetypes import guess_all_extensions
                    
30from email.header import decode_header, make_header
                    
31from email.errors import HeaderParseError
                    
37sre = re.compile(r'[^-\w.]')
                    
38# Regexp to strip out leading dots
                    
39dre = re.compile(r'^\.*')
                    
60
                    
61    http://ginstrom.com/scribbles/2007/11/19/parsing-multilingual-email-with-python/
                    
62    """
                    
98
                    
99    http://ginstrom.com/scribbles/2007/11/19/parsing-multilingual-email-with-python/
                    
100    """
                    
139                    ctype.decode("ascii")
                    
140                # XXX Under email 2.5, it is possible that payload will be
                    
141                # None. This can happen when you have a Content-Type:
                    
                
suggestnominations.py https://gitlab.com/x33n/phantomjs | Python | 305 lines
                    
172        counter_by_name = analysis['counters_by_name'].get(author_name)
                    
173        counter_by_email = analysis['counters_by_email'].get(author_email)
                    
174        if counter_by_name:
                    
181                    counter_by_name['names'] |= counter_by_email['names']
                    
182                    counter_by_name['emails'] |= counter_by_email['emails']
                    
183                    counter_by_name['count'] += counter_by_email.get('count', 0)
                    
195                # Create new counter
                    
196                new_counter = {'names': set([author_name]), 'emails': set([author_email]), 'latest_name': author_name, 'latest_email': author_email, 'commits': ""}
                    
197                analysis['counters_by_name'][author_name] = new_counter
                    
226
                    
227            contributor = self._committer_list.contributor_by_email(author_email)
                    
228
                    
282            counter['names'] = counter['names'] - set([author_name])
                    
283            counter['emails'] = counter['emails'] - set([author_email])
                    
284
                    
                
forms.py https://github.com/tgavankar/kitsune.git | Python | 336 lines
                    
228    """A simple form that requires an email address."""
                    
229    email = forms.EmailField(label=_lazy(u'Email address:'))
                    
230
                    
234    not the current user's email."""
                    
235    email = forms.EmailField(label=_lazy(u'Email address:'))
                    
236
                    
244            raise forms.ValidationError(_('This is your current email.'))
                    
245        if User.objects.filter(email=email).exists():
                    
246            raise forms.ValidationError(_('A user with that email address '
                    
282    Requires an email address."""
                    
283    email = forms.EmailField(label=_lazy(u'Email address:'))
                    
284
                    
297
                    
298    def save(self, email_template='users/email/forgot_username.ltxt',
                    
299             use_https=False, request=None):
                    
                
forms.py https://github.com/radicsoft/django.git | Python | 218 lines
                    
13    """
                    
14    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
15        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
47class UserChangeForm(forms.ModelForm):
                    
48    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
49        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
107class PasswordResetForm(forms.Form):
                    
108    email = forms.EmailField(label=_("E-mail"), max_length=75)
                    
109
                    
122
                    
123    def save(self, domain_override=None, email_template_name='registration/password_reset_email.html',
                    
124             use_https=False, token_generator=default_token_generator, from_email=None, request=None):
                    
146            send_mail(_("Password reset on %s") % site_name,
                    
147                t.render(Context(c)), from_email, [user.email])
                    
148
                    
                
teachable.py https://gitlab.com/vitalii.dr/yt-dlp | Python | 297 lines
                    
65        login_form.update({
                    
66            'user[email]': username,
                    
67            'user[password]': password,
                    
69
                    
70        post_url = self._search_regex(
                    
71            r'<form[^>]+action=(["\'])(?P<url>(?:(?!\1).)+)\1', login_page,
                    
180        chapter_number = None
                    
181        section_item = self._search_regex(
                    
182            r'(?s)(?P<li><li[^>]+\bdata-lecture-id=["\']%s[^>]+>.+?</li>)' % video_id,
                    
184        if section_item:
                    
185            chapter_number = int_or_none(self._search_regex(
                    
186                r'data-ss-position=["\'](\d+)', section_item, 'section id',
                    
272                continue
                    
273            lecture_url = self._search_regex(
                    
274                r'<a[^>]+href=(["\'])(?P<url>(?:(?!\1).)+)\1', li,
                    
                
test_membership.py https://gitlab.com/noc0lour/mailman | Python | 237 lines
                    
100                          system_preferences.preferred_language))
                    
101        self.assertEqual(member.address.email, 'anne@example.com')
                    
102
                    
103    def test_add_member_banned_by_pattern(self):
                    
104        # Addresses matching regexp ban patterns cannot subscribe.
                    
105        IBanManager(self._mlist).ban('^.*@example.com')
                    
187
                    
188    def test_add_member_with_mixed_case_email(self):
                    
189        # LP: #1425359 - Mailman is case-perserving, case-insensitive.  This
                    
203                              system_preferences.preferred_language))
                    
204        self.assertEqual(cm.exception.email, email)
                    
205
                    
221                              system_preferences.preferred_language))
                    
222        self.assertEqual(cm.exception.email, email.lower())
                    
223
                    
                
models.py https://github.com/pnajafi/myewb2.git | Python | 107 lines
                    
19
                    
20from emailconfirmation.models import EmailAddress
                    
21
                    
26""" Thanks to http://www.djangosnippets.org/snippets/176/ """
                    
27class CurrencyField (forms.RegexField):
                    
28    currencyRe = re.compile(r'^[0-9]{1,5}(.[0-9][0-9])?$')
                    
93    phone = models.CharField(_('phone number'), max_length=45)
                    
94    email = models.EmailField(_('email address'))
                    
95    
                    
                
forms.py https://github.com/botum/sabelo.git | Python | 194 lines
                    
104    user   = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
                    
105    email  = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
                    
106    def __init__(self, question, *args, **kwargs):
                    
160class EditUserForm(forms.Form):
                    
161    email = forms.EmailField(label=u'Email', help_text=_('this email does not have to be linked to gravatar'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
                    
162    realname = forms.CharField(label=_('Real name'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35}))
                    
169        super(EditUserForm, self).__init__(*args, **kwargs)
                    
170        self.fields['email'].initial = user.email
                    
171        self.fields['realname'].initial = user.real_name
                    
183        """For security reason one unique email in database"""
                    
184        if self.user.email != self.cleaned_data['email']:
                    
185            if 'email' in self.cleaned_data:
                    
186                try:
                    
187                    user = User.objects.get(email = self.cleaned_data['email'])
                    
188                except User.DoesNotExist:
                    
                
trash.py https://gitlab.com/billyprice1/dump-scraper | Python | 233 lines
                    
39        # Let's compile some regexes to speed up the execution
                    
40        self.regex['emailsOnly'] = re.compile(r'^[\s"]?[a-z0-9\-\._]+@[a-z0-9\-\.]+\.[a-z]{2,4}[\s|\t]?$', re.I | re.M)
                    
41        self.regex['debugHex'] = re.compile(r'0x[a-f0-9]{8}', re.I)
                    
41        self.regex['debugHex'] = re.compile(r'0x[a-f0-9]{8}', re.I)
                    
42        self.regex['winPath'] = re.compile(r'[A-Z]:\\\.*?\\\.*?\\\\', re.M)
                    
43
                    
112
                    
113    def detectEmailsOnly(self):
                    
114        """
                    
114        """
                    
115        Detect full list of email addresses only, useless for us
                    
116        :return:
                    
117        """
                    
118        emails = re.findall(self.regex['emailsOnly'], self.data)
                    
119
                    
                
models.py https://gitlab.com/fscons/ticketshop | Python | 220 lines
                    
5
                    
6from django.core.validators import RegexValidator
                    
7from django.db import models
                    
11from .mails import (
                    
12    send_payment_confirmation_email,
                    
13    send_cancellation_email)
                    
146        max_length=200)
                    
147    contact_email = models.EmailField(
                    
148            verbose_name="E-mail")
                    
150            default=False,
                    
151            verbose_name="I would like to get emails about future conferences")
                    
152    additional_information = models.TextField(
                    
160                           default=randrefnumber,
                    
161                           validators=[RegexValidator(regex=r"^\d{10}$")])
                    
162
                    
                
forms.py https://github.com/oremj/kitsune.git | Python | 246 lines
                    
25EMAIL_REQUIRED = _lazy(u'Email address is required.')
                    
26EMAIL_SHORT = _lazy(u'Email address is too short (%(show_value)s characters). '
                    
27                    'It must be at least %(limit_value)s characters.')
                    
74                        'max_length': USERNAME_LONG})
                    
75    email = forms.EmailField(label=_lazy(u'Email address:'),
                    
76                             error_messages={'required': EMAIL_REQUIRED,
                    
106    def clean_email(self):
                    
107        email = self.cleaned_data['email']
                    
108        if User.objects.filter(email=email).exists():
                    
205    """A simple form that requires an email address."""
                    
206    email = forms.EmailField(label=_lazy(u'Email address:'))
                    
207
                    
211    not the current user's email."""
                    
212    email = forms.EmailField(label=_lazy(u'Email address:'))
                    
213
                    
                
owners.py https://bitbucket.org/kaendfinger/depot_tools.git | Python | 299 lines
                    
28Email addresses must follow the foo@bar.com short form (exact syntax given
                    
29in BASIC_EMAIL_REGEXP, below). Filename globs follow the simple unix
                    
30shell conventions, and relative and absolute paths are not allowed (i.e.,
                    
32
                    
33If a user's email is one of the email_addresses in the file, the user is
                    
34considered an "OWNER" for all files in the directory.
                    
60# Recognizes 'X@Y' email addresses. Very simplistic.
                    
61BASIC_EMAIL_REGEXP = r'^[\w\-\+\%\.]+\@[\w\-\+\%\.]+$'
                    
62
                    
105    # Pick a default email regexp to use; callers can override as desired.
                    
106    self.email_regexp = re.compile(BASIC_EMAIL_REGEXP)
                    
107
                    
138        files is a sequence of paths relative to (and under) self.root.
                    
139        reviewers is a sequence of strings matching self.email_regexp.
                    
140    """
                    
                
settings.py https://bitbucket.org/liutaihua/yyu.git | Python | 308 lines
                    
140    # def GET(self):
                    
141    #     e = users.get_confirm_email_by_email(user.email)
                    
142    #     c = e.get('confirmed')
                    
149    def POST(self):
                    
150        email = web.input().email
                    
151
                    
152        #检查是否变动
                    
153        old_email = users.get_user_by_id(user.id).email
                    
154        if email == old_email:
                    
157        #检查新邮箱是否已经存在
                    
158        elif not users.is_email_available(email):
                    
159            return '{"status":"n", "code":"n-ybsy", "info":"此邮箱已被使用"}'
                    
171            
                    
172            email_templates.change_email(email, token)
                    
173            print '======email send======'
                    
                
utils.py https://github.com/sagarun/askbot-devel.git | Python | 236 lines
                    
8            username = None, 
                    
9            email = None, 
                    
10            notification_schedule = None,
                    
28    and values as keys in 
                    
29    :attr:`~askbot.models.EmailFeedSetting.FEED_TYPES`:
                    
30
                    
35    """
                    
36    user = models.User.objects.create_user(username, email)
                    
37
                    
43    if notification_schedule == None:
                    
44        notification_schedule = models.EmailFeedSetting.NO_EMAIL_SCHEDULE
                    
45        
                    
87                    username = username,
                    
88                    email = email,
                    
89                    notification_schedule = notification_schedule,
                    
                
forms.py https://github.com/seblach/django.git | Python | 227 lines
                    
16    """
                    
17    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
18        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
50class UserChangeForm(forms.ModelForm):
                    
51    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
                    
52        help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
                    
110class PasswordResetForm(forms.Form):
                    
111    email = forms.EmailField(label=_("E-mail"), max_length=75)
                    
112
                    
143            c = {
                    
144                'email': user.email,
                    
145                'domain': domain,
                    
155            email = loader.render_to_string(email_template_name, c)
                    
156            send_mail(subject, email, from_email, [user.email])
                    
157
                    
                
0005_auto.py https://github.com/mrj0/opencomparison.git | Python | 129 lines
                    
42            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
                    
43            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
                    
44            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
                    
120            'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
                    
121            'repo_regex': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'blank': 'True'}),
                    
122            'slug_regex': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'blank': 'True'}),
                    
124            'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
                    
125            'user_regex': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'blank': 'True'})
                    
126        }
                    
                
test_data_forceschedulers.py https://gitlab.com/murder187ss/buildbot | Python | 166 lines
                    
31                                'name': 'username',
                    
32                                'need_email': True,
                    
33                                'regex': None,
                    
43                                'name': 'reason',
                    
44                                'regex': None,
                    
45                                'required': False,
                    
54                    'name': '',
                    
55                    'regex': None,
                    
56                    'required': False,
                    
66                                'name': 'project',
                    
67                                'regex': None,
                    
68                                'required': False,
                    
77                                'name': 'repository',
                    
78                                'regex': None,
                    
79                                'required': False,
                    
                
mailerdaemon.py https://gitlab.com/abhi1tb/build | Python | 246 lines
                    
85# list of re's used to find reasons (error messages).
                    
86# if a string, "<>" is replaced by a copy of the email address.
                    
87# The expressions are searched for in order.  After the first match,
                    
118                        break
                    
119                    emails.append(res.group('email'))
                    
120                break
                    
123            if res is not None:
                    
124                emails.append(res.group('email'))
                    
125                try:
                    
139                    email = emails[i]
                    
140                    exp = re.compile(re.escape(email).join(regexp.split('<>')), re.MULTILINE)
                    
141                    res = exp.search(data)
                    
149                break
                    
150    for email in emails:
                    
151        errors.append(' '.join((email.strip()+': '+reason).split()))
                    
                
app.py https://github.com/afrims/afrims.git | Python | 317 lines
                    
34
                    
35def daily_email_callback(router, *args, **kwargs):
                    
36    """
                    
36    """
                    
37    Send out daily email report of confirmed/unconfirmed appointments.
                    
38    """
                    
42    except ValueError:
                    
43        logging.debug('ValueError for specified days in daily_email_callback. Value used was %s. Using default value:7' % days)
                    
44        days = 7
                    
57        subject = subject_template.format(**context)
                    
58        body = render_to_string('reminders/emails/daily_report_message.html', context)
                    
59        group_name = settings.DEFAULT_DAILY_REPORT_GROUP_NAME
                    
61        if not created:
                    
62            emails = [c.email for c in group.contacts.all() if c.email]
                    
63            if emails:
                    
                
test_validator.py https://github.com/ptahproject/ptah.git | Python | 209 lines
                    
112
                    
113class TestRegex(TestCase):
                    
114    def _makeOne(self, pattern):
                    
114    def _makeOne(self, pattern):
                    
115        from ptah.form import Regex
                    
116        return Regex(pattern)
                    
117
                    
118    def test_valid_regex(self):
                    
119        self.assertEqual(self._makeOne('a')(None, 'a'), None)
                    
123
                    
124    def test_invalid_regexs(self):
                    
125        from ptah.form import Invalid
                    
128
                    
129    def test_regex_not_string(self):
                    
130        from ptah.form import Invalid
                    
                
views.py https://github.com/theosp/google_appengine.git | Python | 188 lines
                    
38            # not be allowed, but things like /view/?param=http://example.com
                    
39            # should be allowed. This regex checks if there is a '//' *before* a
                    
40            # question mark.
                    
105def password_reset(request, is_admin_site=False, template_name='registration/password_reset_form.html',
                    
106        email_template_name='registration/password_reset_email.html',
                    
107        password_reset_form=PasswordResetForm, token_generator=default_token_generator,
                    
116            opts['token_generator'] = token_generator
                    
117            opts['email_template_name'] = email_template_name
                    
118            opts['request'] = request
                    
                
common.py https://github.com/h3/django.git | Python | 168 lines
                    
42        if 'HTTP_USER_AGENT' in request.META:
                    
43            for user_agent_regex in settings.DISALLOWED_USER_AGENTS:
                    
44                if user_agent_regex.search(request.META['HTTP_USER_AGENT']):
                    
92    def process_response(self, request, response):
                    
93        "Send broken link emails and calculate the Etag, if needed."
                    
94        if response.status_code == 404:
                    
94        if response.status_code == 404:
                    
95            if settings.SEND_BROKEN_LINK_EMAILS and not settings.DEBUG:
                    
96                # If the referrer was from an internal link or a non-search-engine site,
                    
                
0001_initial.py https://gitlab.com/rmishra7/chhout.web.backend | Python | 85 lines
                    
29                ('name', models.CharField(max_length=120, verbose_name='Your Name')),
                    
30                ('email', models.EmailField(max_length=70, unique=True, verbose_name='Email')),
                    
31                ('username', models.CharField(max_length=32, unique=True, verbose_name='Profilename')),
                    
31                ('username', models.CharField(max_length=32, unique=True, verbose_name='Profilename')),
                    
32                ('contact_no', models.CharField(max_length=15, validators=[django.core.validators.RegexValidator('^\\s*(?:\\+?(\\d{1,3}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})(?: *x(\\d+))?\\s*$'), django.core.validators.MinLengthValidator(6), django.core.validators.MaxLengthValidator(15)], verbose_name='Contact Number')),
                    
33                ('image', models.FileField(default='user-default.png', upload_to=accounts.models.user_image_upload, verbose_name='Image')),
                    
37                ('role', models.CharField(choices=[('1', 'Admin'), ('2', 'Customer/User'), ('3', 'Delivery Boy')], default=2, max_length=1, verbose_name='Profile Role')),
                    
38                ('email_alerts', models.BooleanField(default=False, verbose_name='Email Alerts')),
                    
39                ('sms_alerts', models.BooleanField(default=False, verbose_name='SMS Alerts')),
                    
                
validators.py https://github.com/etianen/django.git | Python | 289 lines
                    
27        if regex is not None:
                    
28            self.regex = regex
                    
29        if message is not None:
                    
41        if isinstance(self.regex, six.string_types):
                    
42            self.regex = re.compile(self.regex, self.flags)
                    
43
                    
56            self.regex.pattern == other.regex.pattern and
                    
57            self.regex.flags == other.regex.flags and
                    
58            (self.message == other.message) and
                    
67@deconstructible
                    
68class URLValidator(RegexValidator):
                    
69    regex = re.compile(
                    
183
                    
184validate_email = EmailValidator()
                    
185
                    
                
myflaskapp.py https://gitlab.com/vschmidt94/ubiquitous-octo-wookie | Python | 195 lines
                    
60
                    
61    error = None    # to implement validation later - should validate email
                    
62
                    
71    lname = request.form['lname']
                    
72    email = request.form['email']
                    
73    favs = request.form['fav_genres']
                    
83                    "lname": lname,
                    
84                    "email": email,
                    
85                    "fav_genres": favs,
                    
156
                    
157    # TODO - add regex validation of name, alpha chars at least length 4
                    
158
                    
                
convert.py https://gitlab.com/jeffglover/contactsjsonmod | Python | 111 lines
                    
28
                    
29    supports validating rows, currently when enabled expects an email column
                    
30    '''
                    
31
                    
32    valid_email = re.compile(
                    
33        r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$")
                    
42        if self.santize_rows:
                    
43            # initilize the RowSantizer to run a regex match on the 'email'
                    
44            # column
                    
44            # column
                    
45            self.email_column = "email"
                    
46            self.email_sanitizer = RowSanitizer(
                    
46            self.email_sanitizer = RowSanitizer(
                    
47                self.email_column, self.valid_email.match)
                    
48
                    
                
forms.py https://gitlab.com/andreweua/timtec | Python | 166 lines
                    
17
                    
18    email = forms.RegexField(label=_("email"), max_length=75, regex=r"^[\w.@+-]+$")
                    
19
                    
54        model = get_user_model()
                    
55        fields = ('ifid', 'first_name', 'last_name', 'email', 'campus', 'city', 'course', 'klass')
                    
56
                    
82        model = get_user_model()
                    
83        fields = ('first_name', 'last_name', 'email', 'campus', 'city', 'siape', 'cpf')
                    
84
                    
109        model = get_user_model()
                    
110        fields = ('first_name', 'last_name', 'email', 'campus', 'city', 'course', 'klass')
                    
111
                    
                
forms.py https://github.com/qualitio/qualitio.git | Python | 174 lines
                    
28
                    
29    slug = forms.RegexField(
                    
30        regex="^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$",
                    
51class NewMemberForm(core.BaseForm):
                    
52    email = forms.EmailField(required=True, label="E-mail address")
                    
53
                    
54    def clean_email(self):
                    
55        email = self.cleaned_data.get('email')
                    
56        if auth.User.objects.filter(
                    
57            organization_member__organization=THREAD.organization,
                    
58            email=self.cleaned_data.get('email')
                    
59        ):
                    
74
                    
75        email = self.cleaned_data.get('email')
                    
76        if auth.User.objects.filter(username=email).exists():
                    
                
debugerror.py https://github.com/edmundt/Readable-Feeds.git | Python | 355 lines
                    
10
                    
11__all__ = ["debugerror", "djangoerror", "emailerrors"]
                    
12
                    
87        strClassName = strClassName.replace(/\-/g, "\\-");
                    
88        var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$$)");
                    
89        var oElement;
                    
91            oElement = arrElements[i];
                    
92            if(oRegExp.test(oElement.className)){
                    
93                arrReturnElements.push(oElement);
                    
300
                    
301def emailerrors(email_address, olderror):
                    
302    """
                    
303    Wraps the old `internalerror` handler (pass as `olderror`) to 
                    
304    additionally email all errors to `email_address`, to aid in 
                    
305    debugging production websites.
                    
                
schema.py https://github.com/eea/eea.usersdb.git | Python | 140 lines
                    
13)
                    
14INVALID_EMAIL = "Invalid email format %s"
                    
15
                    
76# max length for domain name labels is 63 characters per RFC 1034
                    
77_url_validator = colander.Regex(r'^http[s]?\://', msg=INVALID_URL)
                    
78
                    
79
                    
80def _email_validator(node, value):
                    
81    """ email validator """
                    
84    if not re.match(pattern, value):
                    
85        raise colander.Invalid(node, INVALID_EMAIL % value)
                    
86
                    
108        colander.String(), missing='', description='Job title')
                    
109    email = colander.SchemaNode(
                    
110        colander.String(), validator=_email_validator, description='E-mail')
                    
                
utils.py https://github.com/rlr/kitsune.git | Python | 136 lines
                    
55                subject=subject,
                    
56                email_data=email_data,
                    
57                volunteer_interest=form.cleaned_data['interested'],
                    
62                # so there is no race condition.
                    
63                User.objects.filter(email=form.instance.email).delete()
                    
64            else:
                    
87
                    
88    @email_utils.safe_translation
                    
89    def _make_mail(locale):
                    
94            context_vars={'contributor': user},
                    
95            from_email=settings.DEFAULT_FROM_EMAIL,
                    
96            to_email=user.email)
                    
106    username_regex = r'^{0}[0-9]*$'.format(username)
                    
107    users = User.objects.filter(username__iregex=username_regex)
                    
108
                    
                
validators.py https://github.com/theosp/google_appengine.git | Python | 197 lines
                    
25        if regex is not None:
                    
26            self.regex = regex
                    
27        if message is not None:
                    
33        if isinstance(self.regex, six.string_types):
                    
34            self.regex = re.compile(self.regex)
                    
35
                    
39        """
                    
40        if not self.regex.search(force_text(value)):
                    
41            raise ValidationError(self.message, code=self.code)
                    
80
                    
81class EmailValidator(RegexValidator):
                    
82
                    
103    r'|\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]$', re.IGNORECASE)  # literal form, ipv4 address (SMTP 4.1.3)
                    
104validate_email = EmailValidator(email_re, _('Enter a valid email address.'), 'invalid')
                    
105
                    
                
link_collect.py https://bitbucket.org/clarifiednetworks/graphingwiki/ | Python | 332 lines
                    
10
                    
11from graphingwiki.util import category_regex
                    
12from wiki_form import Parser as listParser
                    
28        self.in_dd = 0
                    
29        self.cat_re=category_regex(request)
                    
30
                    
197
                    
198    def _email_repl(self, word, groups):
                    
199        self.__add_meta(word, groups)
                    
                
dispatch.py https://bitbucket.org/mgill25/debian-pts.git | Python | 184 lines
                    
57def get_message(mail_content):
                    
58    """Read email and make an email Message"""
                    
59    msg = email.message_from_string(mail_content)
                    
82
                    
83def header_matches(msg, header, regex):
                    
84    return re.match(regex, msg.get(header, ""))
                    
150    """Keep track of the sent mails, to be able to match them later with bounces"""
                    
151    b = Bounce(email=email, sent=True)
                    
152    b.save()
                    
174    for email in mail_list:
                    
175        print("Sending email to: ", email.address)
                    
176        from_addr = encode(settings.BOUNCE_ADDR, email.address)
                    
178        if from_addr:
                    
179            send_email(msg, from_addr, email.address, archive)
                    
180            track_mail(email)
                    
                
changelog.py https://gitlab.com/x33n/phantomjs | Python | 459 lines
                    
148    def _split_author_names_with_emails(cls, text):
                    
149        regex = '>' + ChangeLogEntry.split_names_regexp
                    
150        names = re.split(regex, text)
                    
164        match = re.match(r'(?P<name>.+?)\s+<(?P<email>[^>]+)>', author_name_and_email)
                    
165        return {'name': match.group("name"), 'email': match.group("email")}
                    
166
                    
215        self._reviewers = self._fuzz_match_reviewers(self._reviewers_text_list)
                    
216        self._author = self._committer_list.contributor_by_email(self.author_email()) or self._committer_list.contributor_by_name(self.author_name())
                    
217
                    
326        date_line_regexp = re.compile(ChangeLogEntry.date_line_regexp)
                    
327        rolled_over_regexp = re.compile(ChangeLogEntry.rolled_over_regexp)
                    
328
                    
331        assert(isinstance(first_line, unicode))
                    
332        if not date_line_regexp.match(cls.svn_blame_regexp.sub('', first_line)):
                    
333            raise StopIteration
                    
                
forcesched.py https://gitlab.com/murder187ss/buildbot | Python | 780 lines
                    
17
                    
18import email.utils as email_utils
                    
19import re
                    
112
                    
113        @param regex: (optional) regex to validate the value with. Not used by
                    
114                      all subclasses
                    
114                      all subclasses
                    
115        @type regex: unicode or regex
                    
116        """
                    
123        if regex:
                    
124            self.regex = re.compile(regex)
                    
125        if 'value' in kw:
                    
266                raise ValidationError("%s: please fill in email address in the "
                    
267                                      "form 'User <email@email.com>'" % (self.name,))
                    
268        return s
                    
                
javascripttokenizer.py https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Python | 363 lines
                    
87  # Comment text is anything that we are not going to parse into another special
                    
88  # token like (inline) flags or end comments. Complicated regex to match
                    
89  # most normal characters, and '*', '{', '}', and '@' when we are sure that
                    
91  # match everything before @, and we won't match @'s that aren't part of flags
                    
92  # like in email addresses in the @author tag.
                    
93  DOC_COMMENT_TEXT = re.compile(r'([^*{}\s]@|[^*{}@]|\*(?!/))+')
                    
123                     (?=\s*(%s))
                    
124                     """ % (REGEX_CHARACTER_CLASS, '|'.join(POST_REGEX_LIST)),
                    
125                     re.VERBOSE)
                    
222        # of which could be intertwined.  'string with /regex/',
                    
223        # /regex with 'string'/, /* comment with /regex/ and string */ (and so
                    
224        # on)
                    
236                JavaScriptModes.DOUBLE_QUOTE_STRING_MODE),
                    
237        Matcher(REGEX, Type.REGEX),
                    
238
                    
                
error_fixer.py https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Python | 447 lines
                    
36
                    
37# Regex to represent common mistake inverting author name and email as
                    
38# @author User Name (user@company)
                    
42                                  '\('
                    
43                                  '(?P<email>[^\s]+@[^)\s]+)'
                    
44                                  '\)'
                    
295        token.string = '%s%s%s(%s)%s' % (match.group('leading_whitespace'),
                    
296                                         match.group('email'),
                    
297                                         match.group('whitespace_after_name'),
                    
                
gmock_doctor.py https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | Python | 617 lines
                    
40
                    
41_EMAIL = 'googlemock@googlegroups.com'
                    
42
                    
52    'Contains',
                    
53    'ContainsRegex',
                    
54    'DoubleEq',
                    
68    'Matches',
                    
69    'MatchesRegex',
                    
70    'NanSensitiveDoubleEq',
                    
129
                    
130# Regex for matching source file path and line number in the compiler's errors.
                    
131_GCC_FILE_LINE_RE = r'(?P<file>.*):(?P<line>\d+):\s+'
                    
136
                    
137def _FindAllMatches(regex, s):
                    
138  """Generates all matches of regex in string s."""
                    
                
tableForm.py https://gitlab.com/tim-jyu/tim | Python | 759 lines
                    
26)
                    
27from timApp.plugin.tableform.comparatorFilter import RegexOrComparator
                    
28from timApp.plugin.taskid import TaskId
                    
103    dataCollection: str | Missing | None = missing
                    
104    emails: bool | Missing = missing
                    
105    addedDates: bool | Missing = missing
                    
105    addedDates: bool | Missing = missing
                    
106    emailUsersButtonText: str | Missing | None = missing
                    
107    filterRow: bool | Missing | None = missing
                    
212                id=-100000,
                    
213                email="",
                    
214            )
                    
346usernames: false  # Show user name column
                    
347emails: false     # Show email column
                    
348addedDates: false # Show the date the user was added
                    
                
mailerdaemon.py https://bitbucket.org/glix/python.git | Python | 237 lines
                    
98    errors = []
                    
99    emails = []
                    
100    reason = None
                    
112                        break
                    
113                    emails.append(res.group('email'))
                    
114                break
                    
117            if res is not None:
                    
118                emails.append(res.group('email'))
                    
119                try:
                    
133                    email = emails[i]
                    
134                    exp = re.compile(re.escape(email).join(regexp.split('<>')), re.MULTILINE)
                    
135                    res = exp.search(data)
                    
143                break
                    
144    for email in emails:
                    
145        errors.append(' '.join((email.strip()+': '+reason).split()))
                    
                
header.py https://github.com/vesnican/play.git | Python | 503 lines
                    
2# Author: Ben Gertzfield, Barry Warsaw
                    
3# Contact: email-sig@python.org
                    
4
                    
15
                    
16import email.quoprimime
                    
17import email.base64mime
                    
18
                    
19from email.errors import HeaderParseError
                    
20from email.charset import Charset
                    
44
                    
45# Field name regexp, including trailing colon, but not separating whitespace,
                    
46# according to RFC 2822.  Character range is from tilde to exclamation mark.
                    
52# Helpers
                    
53_max_append = email.quoprimime._max_append
                    
54
                    
                
mathtext.py https://github.com/tris-sondon/matplotlib.git | Python | 1442 lines
                    
17If you find TeX expressions that don't parse or render properly,
                    
18please email mdroe@stsci.edu, but please check KNOWN ISSUES below first.
                    
19"""
                    
42     ParseResults, Suppress, oneOf, StringEnd, ParseFatalException, \
                    
43     FollowedBy, Regex, ParserElement, QuotedString, ParseBaseException
                    
44
                    
                
99_regex_reference.py https://gitlab.com/varunkothamachu/DAT3 | Python | 251 lines
                    
1'''
                    
2Regular Expressions (regex) Reference Guide
                    
3
                    
135
                    
136s = 'my email is john-doe@gmail.com'
                    
137
                    
172
                    
173s = 'my email is john-doe@gmail.com'
                    
174
                    
190
                    
191s = 'emails: joe@gmail.com, bob@gmail.com'
                    
192
                    
216
                    
217s = 'emails: nicole@ga.co, joe@gmail.com, PAT@GA.CO'
                    
218
                    
                
lynda.py https://gitlab.com/vitalii.dr/yt-dlp | Python | 334 lines
                    
32    def _perform_login_step(self, form_html, fallback_action_url, extra_form_data, note, referrer_url):
                    
33        action_url = self._search_regex(
                    
34            r'<form[^>]+action=(["\'])(?P<url>.+?)\1', form_html,
                    
50
                    
51        self._check_error(response, ('email', 'password', 'ErrorMessage'))
                    
52
                    
64
                    
65        # Step 2: submit email
                    
66        signin_form = self._search_regex(
                    
69        signin_page, signin_url = self._login_step(
                    
70            signin_form, self._PASSWORD_URL, {'email': username},
                    
71            'Submitting email', self._SIGNIN_URL)
                    
75        self._login_step(
                    
76            password_form, self._USER_URL, {'email': username, 'password': password},
                    
77            'Submitting password', signin_url)
                    
                
constants.py https://github.com/paul356/evernote-plugin-for-vim.git | Python | 200 lines
                    
27
                    
28EDAM_EMAIL_LOCAL_REGEX = "^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*$"
                    
29
                    
29
                    
30EDAM_EMAIL_DOMAIN_REGEX = "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*\\.([A-Za-z]{2,})$"
                    
31
                    
31
                    
32EDAM_EMAIL_REGEX = "^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*\\.([A-Za-z]{2,})$"
                    
33
                    
102
                    
103EDAM_USER_USERNAME_REGEX = "^[a-z0-9]([a-z0-9_-]{0,62}[a-z0-9])?$"
                    
104
                    
114
                    
115EDAM_TAG_NAME_REGEX = "^[^,\\p{Cc}\\p{Z}]([^,\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^,\\p{Cc}\\p{Z}])?$"
                    
116
                    
                
test_email.py https://github.com/albertz/CPython.git | Python | 1193 lines
                    
17import email
                    
18import email.policy
                    
19
                    
20from email.charset import Charset
                    
21from email.header import Header, decode_header, make_header
                    
22from email.parser import Parser, HeaderParser
                    
33from email import utils
                    
34from email import errors
                    
35from email import encoders
                    
40from test.support import unlink, start_threads
                    
41from test.test_email import openfile, TestEmailBase
                    
42
                    
374        eq = self.assertEqual
                    
375        msg = email.message_from_string(
                    
376            "X-Header: foo=one; bar=two; baz=three\n")
                    
                
test_contentmanager.py https://github.com/albertz/CPython.git | Python | 796 lines
                    
1import unittest
                    
2from test.test_email import TestEmailBase, parameterize
                    
3import textwrap
                    
4from email import policy
                    
5from email.message import EmailMessage
                    
6from email.contentmanager import ContentManager, raw_data_manager
                    
9@parameterize
                    
10class TestContentManager(TestEmailBase):
                    
11
                    
12    policy = policy.default
                    
13    message = EmailMessage
                    
14
                    
51        m['Content-Type'] = 'text/plain'
                    
52        with self.assertRaisesRegex(KeyError, 'text/plain'):
                    
53            cm.get_content(m)
                    
                
test_with.py https://github.com/albertz/CPython.git | Python | 747 lines
                    
4__author__ = "Mike Bland"
                    
5__email__ = "mbland at acm dot org"
                    
6
                    
119            with foo: pass
                    
120        self.assertRaisesRegex(AttributeError, '__enter__', fooLacksEnter)
                    
121
                    
128            with foo: pass
                    
129        self.assertRaisesRegex(AttributeError, '__enter__', fooLacksEnterAndExit)
                    
130
                    
138            with foo: pass
                    
139        self.assertRaisesRegex(AttributeError, '__exit__', fooLacksExit)
                    
140
                    
                
test_smtplib.py https://github.com/albertz/CPython.git | Python | 1280 lines
                    
3import email.mime.text
                    
4from email.message import EmailMessage
                    
5from email.base64mime import body_encode as encode_base64
                    
5from email.base64mime import body_encode as encode_base64
                    
6import email.utils
                    
7import hmac
                    
135        expected = re.compile(r"^connect:", re.MULTILINE)
                    
136        self.assertRegex(stderr.getvalue(), expected)
                    
137
                    
146                              re.MULTILINE)
                    
147        self.assertRegex(stderr.getvalue(), expected)
                    
148
                    
368        sender = re.compile("^sender: <>$", re.MULTILINE)
                    
369        self.assertRegex(debugout, sender)
                    
370
                    
                
test_mailbox.py https://github.com/albertz/CPython.git | Python | 1211 lines
                    
5import socket
                    
6import email
                    
7import email.message
                    
25        # Inspect a mailbox.Message representation of the sample message
                    
26        self.assertIsInstance(msg, email.message.Message)
                    
27        self.assertIsInstance(msg, mailbox.Message)
                    
33            part = msg.get_payload(i)
                    
34            self.assertIsInstance(part, email.message.Message)
                    
35            self.assertNotIsInstance(part, mailbox.Message)
                    
68        self.assertEqual(len(self._box), 2)
                    
69        keys.append(self._box.add(email.message_from_string(_sample_message)))
                    
70        self.assertEqual(len(self._box), 3)
                    
105    def test_add_nonascii_string_header_raises(self):
                    
106        with self.assertRaisesRegex(ValueError, "ASCII-only"):
                    
107            self._box.add(self._nonascii_msg)
                    
                
header.py https://github.com/albertz/CPython.git | Python | 578 lines
                    
2# Author: Ben Gertzfield, Barry Warsaw
                    
3# Contact: email-sig@python.org
                    
4
                    
15
                    
16import email.quoprimime
                    
17import email.base64mime
                    
18
                    
19from email.errors import HeaderParseError
                    
20from email import charset as _charset
                    
44
                    
45# Field name regexp, including trailing colon, but not separating whitespace,
                    
46# according to RFC 2822.  Character range is from tilde to exclamation mark.
                    
56# Helpers
                    
57_max_append = email.quoprimime._max_append
                    
58
                    
                
test_sdist.py https://github.com/albertz/CPython.git | Python | 492 lines
                    
80                        'url': 'xxx', 'author': 'xxx',
                    
81                        'author_email': 'xxx'}
                    
82        dist = Distribution(metadata)
                    
193        self.write_file((hg_dir, 'last-message.txt'), '#')
                    
194        # a buggy regex used to prevent this from working on windows (#6884)
                    
195        self.write_file((self.tmp_dir, 'buildout.cfg'), '#')
                    
                
dist.py https://github.com/albertz/CPython.git | Python | 1245 lines
                    
9import re
                    
10from email import message_from_file
                    
11
                    
22
                    
23# Regex to define acceptable Distutils command names.  This is not *quite*
                    
24# the same as a Python NAME -- I don't allow leading underscores.  The fact
                    
95         "print the author's name"),
                    
96        ('author-email', None,
                    
97         "print the author's email address"),
                    
99         "print the maintainer's name"),
                    
100        ('maintainer-email', None,
                    
101         "print the maintainer's email address"),
                    
103         "print the maintainer's name if known, else the author's"),
                    
104        ('contact-email', None,
                    
105         "print the maintainer's email address if known, else the author's"),
                    
                
test_old_mailbox.py https://github.com/rpattabi/ironruby.git | Python | 160 lines
                    
102        ### should be better!
                    
103        import email.parser
                    
104        fname = self.createMessage("cur", True)
                    
106        for msg in mailbox.PortableUnixMailbox(open(fname),
                    
107                                               email.parser.Parser().parse):
                    
108            n += 1
                    
120
                    
121    def test_from_regex (self):
                    
122        # Testing new regex from bug #1633678
                    
                
forms.py https://github.com/Karaage-Cluster/karaage.git | Python | 431 lines
                    
141                % settings.ACCOUNTS_EMAIL)
                    
142        clean_email(email)
                    
143        return email
                    
253class UnauthenticatedInviteUserApplicationForm(forms.Form):
                    
254    email = forms.EmailField()
                    
255    captcha = CaptchaField(
                    
259    def clean_email(self):
                    
260        email = self.cleaned_data['email']
                    
261
                    
261
                    
262        query = Person.active.filter(email=email)
                    
263        if query.count() > 0:
                    
267
                    
268        clean_email(email)
                    
269        return email
                    
                
ipaddrctrl.py https://bitbucket.org/beqa/nvdadependencyvirtualenvironment.git | Python | 220 lines
                    
3# Authors:      Will Sadkin
                    
4# Email:        wsadkin@nameconnector.com
                    
5# Created:      02/11/2003
                    
93            kwargs['formatcodes'] = 'F_Sr<>'
                    
94        if not kwargs.has_key('validRegex'):
                    
95            kwargs['validRegex'] = "(  \d| \d\d|(1\d\d|2[0-4]\d|25[0-5]))(\.(  \d| \d\d|(1\d\d|2[0-4]\d|25[0-5]))){3}"
                    
109        field_params = {}
                    
110        field_params['validRegex'] = "(   |  \d| \d |\d  | \d\d|\d\d |\d \d|(1\d\d|2[0-4]\d|25[0-5]))"
                    
111
                    
                
fields.py https://bitbucket.org/tskarthik/clienttracker.git | Python | 158 lines
                    
123    
                    
124class RegexField(DojoFieldMixin, fields.RegexField):
                    
125    widget = widgets.ValidationTextInput
                    
125    widget = widgets.ValidationTextInput
                    
126    js_regex = None # we additionally have to define a custom javascript regexp, because the python one is not compatible to javascript
                    
127    
                    
128    def __init__(self, js_regex=None, *args, **kwargs):
                    
129        self.js_regex = js_regex
                    
130        super(RegexField, self).__init__(*args, **kwargs)
                    
146    
                    
147class EmailField(DojoFieldMixin, fields.EmailField):
                    
148    widget = widgets.EmailTextInput
                    
157    widget = widgets.ValidationTextInput
                    
158    js_regex = '^[-\w]+$' # we cannot extract the original regex input from the python regex
                    
159
                    
                
forms.py https://github.com/jcrobak/hue.git | Python | 207 lines
                    
13    """
                    
14    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
                    
15        help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
                    
46class UserChangeForm(forms.ModelForm):
                    
47    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
                    
48        help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
                    
99class PasswordResetForm(forms.Form):
                    
100    email = forms.EmailField(label=_("E-mail"), max_length=75)
                    
101
                    
105        """
                    
106        email = self.cleaned_data["email"]
                    
107        self.users_cache = User.objects.filter(email__iexact=email)
                    
111
                    
112    def save(self, domain_override=None, email_template_name='registration/password_reset_email.html',
                    
113             use_https=False, token_generator=default_token_generator):
                    
                
fields.py https://bitbucket.org/atmb4u/django-nonrel.git | Python | 955 lines
                    
36    'DateField', 'TimeField', 'DateTimeField', 'TimeField',
                    
37    'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField',
                    
38    'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField',
                    
                
fields.py https://bitbucket.org/elissawolf92/hackpack.git | Python | 961 lines
                    
38    'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField', 'TimeField',
                    
39    'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField',
                    
40    'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField',
                    
                
forms.py https://github.com/sandroden/baruwa.git | Python | 235 lines
                    
32    from django.core.validators import email_re
                    
33from baruwa.utils.regex import ADDRESS_RE
                    
34
                    
40    """
                    
41    def clean_email(self):
                    
42        """
                    
45        """
                    
46        email = self.cleaned_data["email"]
                    
47        self.users_cache = User.objects.filter(email__iexact=email)
                    
116    """
                    
117    address = forms.RegexField(regex=ADDRESS_RE,
                    
118        widget=forms.TextInput(attrs={'size': '50'}))
                    
139            if not email_re.match(address):
                    
140                error_msg = _('provide a valid email address')
                    
141                self._errors["address"] = ErrorList([error_msg])
                    
                
module.py https://gitlab.com/phyks/weboob | Python | 196 lines
                    
36    MAINTAINER = u'Romain Bignon'
                    
37    EMAIL = 'romain@weboob.org'
                    
38    VERSION = '1.3'
                    
40    DESCRIPTION = "phpBB forum"
                    
41    CONFIG = BackendConfig(Value('url',                     label='URL of forum', regexp='https?://.*'),
                    
42                           Value('username',                label='Username', default=''),
                    
                
utils.py https://gitlab.com/pooja043/Globus_Docker_4 | Python | 967 lines
                    
55import re
                    
56import email.mime.multipart
                    
57import email.mime.base
                    
57import email.mime.base
                    
58import email.mime.text
                    
59import email.utils
                    
59import email.utils
                    
60import email.encoders
                    
61import gzip
                    
97
                    
98_first_cap_regex = re.compile('(.)([A-Z][a-z]+)')
                    
99_number_cap_regex = re.compile('([a-z])([0-9]+)')
                    
99_number_cap_regex = re.compile('([a-z])([0-9]+)')
                    
100_end_cap_regex = re.compile('([a-z0-9])([A-Z])')
                    
101
                    
                
 

Source

Language