This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Easy does it!

easy-expressions

The world’s most gangsta regular expressions library.

It turns this..

regex = re.compile(r'(?:(?:\$){1,1})(?:(?:(?:\d)){1,})(?:(?:\.){1,1})(?:\d)(?:\d)')

into this!

from easy_expressions import Easy

easy = Easy() /
  .find("$") /
  .min(1).digits() /
  .then(".") /
  .digit() /
  .digit()

regex = easy.getRegex()
regex.findall("$10.00");

About

easy-expressions is a python regular expressions library with a Python for Humans philosophy. Rather than having to remember the complex regular expressions syntax, easy-expressions allows you to write complicated regular expressions in natural English, so you’ll get your pattern matches right the first time without any headache.

Installation

pip install easy-expressions

Examples

Searching for dollar amounts

from easy_expressions import Easy

easy = Easy() /
  .find("$") /
  .min(1).digits() /
  .then(".") /
  .digit() /
  .digit()

regex.test("$10.00"); # True
regex.test("$XX.YZ"); # False

Searching for Credit Cards

easy = Easy() \
        .startOfLine() \
        .exactly(4).digits() \
        .then('-') \
        .exactly(4).digits() \
        .then('-') \
        .exactly(4).digits() \
        .then('-') \
        .exactly(4).digits()

input_s = "Hey Joe! The credit card number for the invoice is 4444-5555-6666-7777. Thanks!"
easy.test(input_s) # True

input_s = "Hey Joe! The credit card number for the invoice is 1-2-3-4. Thanks!"
easy.test(input_s) # False

Inspiration

Regexes are hard when they should be easy.

I had this idea while watching Straight Outta Compton. Turns out [@thebinarysearchtree](https://github.com/thebinarysearchtree/) had already implemented it in JS, so this is essentially a port of that.

Contributing

This software is still quite young and I’m certain there are still bugs in it. If you find bugs or want new features included, please create a new Issue and send a pull request, along with an accompanying test. Thanks!

Other Easy Projects

If you like easy things, you may also enjoy:

License

MIT, 2015.

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
easy-expressions-0.1.1.tar.gz (4.9 kB) Copy SHA256 Checksum SHA256 Source Oct 29, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting