Skip to main content

A Python package for common regular expressions.

Project description

Common Regex

A python package that provides commonly used regular expressions for validating various types of data.

Installation

pip install pycommonregex

Usage

import re
from pycommonregex import *

print(is_int(5)) # True
print(is_positive_int('5')) # True
print(is_decimal_num('5.5')) # True
print(is_num('-5.5')) # True
print(is_alpha_numeric('abc123')) # True
print(is_alpha_numeric_with_space('abc 123')) # True
print(is_email('email@example.com')) # True
print(is_good_password('Abc123#')) # True
print(is_username('abc_123')) # True
print(is_url('https://www.example.com')) # True
print(is_ipv4('127.0.0.1')) # True
print(is_ipv6('::1')) # True

Functions

  • 'is_int(num)': Check if the given input is an integer.
  • 'is_positive_int(s)': Check if the given input is a positive integer.
  • 'is_decimal_num(s)': Check if the given input is a decimal number.
  • 'is_num(s)': Check if the given input is a number (positive or negative).
  • 'is_alpha_numeric(s)': Check if the given input is alphanumeric (only contains letters and numbers).
  • 'is_alpha_numeric_with_space(s)': Check if the given input is alphanumeric (only contains letters, numbers, and spaces).
  • 'is_email(email)': Check if the given input is a valid email address.
  • 'is_good_password(password)': Check if the given input is a strong password (contains at least 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character, and is at least 8 characters long).
  • 'is_username(username)': Check if the given input is a valid username (contains only letters, numbers, and certain special characters, and is between 4 and 20 characters long).
  • 'is_url(url)': Check if the given input is a valid URL.
  • 'is_ipv4(IPv4)': Check if the given input is a valid IPv4 address.
  • 'is_ipv6(address)': Check if the given input is a valid IPv6 address.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycommonregex-0.1.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

pycommonregex-0.1.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pycommonregex-0.1.2.tar.gz.

File metadata

  • Download URL: pycommonregex-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.10.16.3-microsoft-standard-WSL2

File hashes

Hashes for pycommonregex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a5fac23d90477ec2957b89c34771fd92114e2b69f2bade4854ce88542745683f
MD5 6f1906eec7d3939f92ea7f879a52d69e
BLAKE2b-256 4574228b0aceb41e27b2cc1eadf3bfa76de1403e490795060d5db28250a3200e

See more details on using hashes here.

File details

Details for the file pycommonregex-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pycommonregex-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.10.16.3-microsoft-standard-WSL2

File hashes

Hashes for pycommonregex-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d087e0998093c9f2e31c20d87689d7490d70891b11f46b8ee561cd57c393536c
MD5 54bcd59e290894ff7fbdffb312d3316d
BLAKE2b-256 e547471eef3a6beeb44424514f63f606f3434d22dbc45d1d9d66fcc74227cf38

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page