All Projects → s0md3v → Regxy

s0md3v / Regxy

Python module for making regex painless.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Regxy

Pihole Regex
Custom regex filter list for use with Pi-hole.
Stars: ✭ 799 (+1564.58%)
Mutual labels:  regex
Regex
A sane interface for php's built in preg_* functions
Stars: ✭ 909 (+1793.75%)
Mutual labels:  regex
Rexrex
🦖 Composable JavaScript regular expressions
Stars: ✭ 34 (-29.17%)
Mutual labels:  regex
Chr
🔤 Lightweight R package for manipulating [string] characters
Stars: ✭ 18 (-62.5%)
Mutual labels:  regex
Retest
Command-line regular expression tester
Stars: ✭ 13 (-72.92%)
Mutual labels:  regex
Androidutilcode
AndroidUtilCode 🔥 is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development which have complete demo and unit test. By using it's encapsulated APIs, you can greatly improve the development efficiency. The program mainly consists of two modules which is utilcode, which is commonly used in development, and subutil which is rarely used in development, but the utils can be beneficial to simplify the main module. 🔥
Stars: ✭ 30,239 (+62897.92%)
Mutual labels:  regex
Commonregex
🍫 A collection of common regular expressions for Go
Stars: ✭ 733 (+1427.08%)
Mutual labels:  regex
Golang Regex Tutorial
Golang - Regular Expression Tutorial
Stars: ✭ 1,035 (+2056.25%)
Mutual labels:  regex
Hyper Match
HyperTerm extension which matches regular expressions with predefined commands
Stars: ✭ 15 (-68.75%)
Mutual labels:  regex
Uc Davis Cs Exams Analysis
📈 Regression and Classification with UC Davis student quiz data and exam data
Stars: ✭ 33 (-31.25%)
Mutual labels:  regex
Shallow Clone
Make a shallow clone of an object, array or primitive.
Stars: ✭ 23 (-52.08%)
Mutual labels:  regex
Whitespace Regex
Regular expression for matching the whitespace in a string.
Stars: ✭ 9 (-81.25%)
Mutual labels:  regex
Regex2fat
Turn your favourite regex into FAT32
Stars: ✭ 945 (+1868.75%)
Mutual labels:  regex
Regex Assert Symfony
Common Regex to use with Assert in Symfony's entity
Stars: ✭ 5 (-89.58%)
Mutual labels:  regex
Dfa Regex
A DFA regex engine in java.
Stars: ✭ 34 (-29.17%)
Mutual labels:  regex
Py regular expressions
Learn Python Regular Expressions step by step from beginner to advanced levels
Stars: ✭ 770 (+1504.17%)
Mutual labels:  regex
Comby
A tool for structural code search and replace that supports ~every language.
Stars: ✭ 912 (+1800%)
Mutual labels:  regex
Phobos
The standard library of the D programming language
Stars: ✭ 1,038 (+2062.5%)
Mutual labels:  regex
Inferregex
Infer the regular expression (regex) of a string 🔤 🔢 🔍
Stars: ✭ 41 (-14.58%)
Mutual labels:  regex
Cryptocurrency Address Detector
Detect which cryptocurrency an address corresponds to.
Stars: ✭ 30 (-37.5%)
Mutual labels:  regex

regxy

Python module for making regex painless.

Operations Supported

  • Match everything between two texts
  • Extract emails
  • Extract phone numbers

Installation

You can install it using pip as follows:

pip install regxy

or you can clone this repo for favoring portability:

git clone https://github.com/UltimateHackers/rexgy/

Usages

grab

Lets say there's website which generates a random password when you visit it. By looking at the source code, you find this:

This is your random password: <span color="red" id="pass">puSSySlay3r</span>. Enjoy!

Now you want to write a program which can visit the website can and can return you the generated password. In that case, you can use regxy as follows:

from regxy import grab
password = grab(string, 'id="pass">', '</span>')
print password

Output

puSSySlay3r

The syntax is following:

grab(string, start, end)

Where string is the string you want to process, start and end are the texts within which your infromation of interest lies. In this case your string is the source code of the website which can be extracted by other modules.

graball

Lets say there's a website which has a list of proxies and you want to write a program to extract those proxies. The source code is something like:

<td class="dark">127.0.0.1:80</td>
<td class="dark">127.0.0.2:8080</td>
<td class="dark">127.0.7:80</td>
<td class="dark">127.255.255.255:80</td>

In this case, you can use the graball function which returns all the matches unlike grab which only returns one. The syntax is as same as the grab function but it returns a list and not a string.

from regxy import graball

grab(string, 'dark">', '</td>')

emails

As the name suggest, this function can extract emails from a given string with 99.99% accuracy. Usages:

from regxy import emails
emails(string)

It returns a list of matches.

numbers

This function can extract phone numbers from a given string. Usages:

from regxy import numbers
numbers(string)

It returns a list of matches.

What if there's no match?

Well in that case all the functions return False.

Cheat Sheet

Function Syntax Output
grab grab(string, start, end) string
graball grab(string, start, end) list
emails emails(string) list
numbers numbers(string) list

License & Contribution

Contributions are heartly welcome, doesn't matter if they are bug reports, pull requests or ideas to make regxy better.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].