-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
The usage of simpex
is divided into three main methods: Custom Method, Built-in Method and API Method. Each method offers a unique way to generate regex patterns based on your requirements.
Before that lets see two ways of importing and creating objects using simpex
module:
recommended
from simpex.simpex import simpex
obj = simpex()
import simpex
obj = simpex.simpex()
Now let's explore these methods to find the approach that best suits your needs:
Custom method is used to generate regex patterns tailored to your dataset. This method is ideal when you have specific data and want to create a regex pattern that perfectly matches your input.
- sample dataset size:
- minimum:
3
- maximum:
100
- minimum:
- required data type:
list
- return type:
str
(default) /dict
(if, acu = True) - function:
<obj>.regex()
- parameters:
-
data_set
: dataset (required) -
num
: numbered approach (optional)-
True
: pattern will be created keeping number of characters in mind (eg: phone number) -
False
: default approach (eg: email)
-
-
acu
: accuracy (optional)-
True
: retruns{'regex': <regex pattern>, 'accuracy': <accuracy>}
-
False
: default option
-
-
from simpex.simpex import simpex # importing
email = simpex(['test@mail.com', 'admin@email.com', 'example@mail.co']) # creating simpex obj, with dataset
# With all parameters, obj = simpex(<Dataset>, <True/False>, <True/False>)
pattern = email.regex() # generating regex pattern
oneliner:
pattern = simpex(['test@mail.com', 'admin@email.com', 'example@mail.co']).regex()
Discover the collection of built-in methods that simpex
provides. Choose a built-in pattern that aligns with your needs and generate regex patterns effortlessly.
- available_patterns:
email
phone
url
ipv4
ipv6
mac
credit_card
- required data type:
str
- return type:
str
- function:
<obj>.pattern('<any one of available_patterns>')
- parameters:
-
data_set
: dataset (required)
-
from simpex.simpex import simpex # importing
obj = simpex() # creating simpex obj
pattern = obj.pattern('email') # generating regex pattern
oneliner:
pattern = simpex().pattern('email')
No
api key
is required
Discover how simpex
seamlessly integrates with external APIs to enhance your regex pattern generation capabilities. Enhance your regex game by harnessing the power of AI-driven regex pattern generation through simpex
's API integration. Thank you to websites used in api for providing such wonderful tools.
- available_apis:
API no. | Endpoint | Description | Input | Return Type |
---|---|---|---|---|
1 | https://saasbase.dev/tools/regex-generator | english to regex (AI) | english str | str |
2 | https://www.autoregex.xyz | english to regex (AI) | english str | str |
3 | https://regex.murfasa.com | english to regex (AI) | english str | str |
4 | https://regex.ai | req. multiple data set | large text str | list |
- function:
<obj>.api(<api's number>)
- parameters:
-
data_set
: dataset (required)
-
from simpex.simpex import simpex # importing
email = simpex('email regex pattern') # creating simpex obj, with data
pattern = email.api(1) # generating regex pattern
oneliner:
pattern = simpex('email regex pattern').api(1)
wiki index: Introduction | Getting Started | Installation | Usage