Comments (4)
Hi, I would like to know about this issue in detail. Do you want multiple regex patterns separated by vertical pipe ( | ), or do you want any change in the code to support a list of regex patterns?
I can solve this issue by creating following blocks with different regex pattern for different type of phone Number Patterns.
"Name": "Phone Number",
"Regex": "^(\\s*(?:\\+?(\\d{1,3}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})(?: *x(\\d+))?\\s*)$",
"plural_name": false,
"Description": null,
"Rarity": 0.5,
"URL": null,
"Tags": [
"Identifiers",
"Credentials",
"Phone Number",
"Phone"
],
"Children": {
"path": "phone_codes.json",
"entry": "Location(s): ",
"method": "hashmap"
},
"Examples": {
"Valid": [
"202-555-0178",
"+1-202-555-0156",
"+662025550156",
"+356 202 555 0156"
],
"Invalid": []
}
}```
from pywhat.
I would like to have a list of regexp, so yes, changes in code are needed. Pywhat should concatenate all these regexes into one using pipes(|). Therefore, only regex loader function should be updated.
from pywhat.
Hey, I am able to combine regex patterns dynamically using |
. What is your suggestion for combining other parameters of the block, such as Description, Rarity, URL, Tags, Children, and Examples.
from pywhat.
Hi! I will take our THM flag regex to better show what we want to achieve. (The only part changed is Regex
)
We want to separate multiple regex formats of one identifier into a list of regexes, instead of having all of them together and separated by |
. Some of regexes are quite long and seeing where is what is getting harder, so our goal is to improve their readability.
I am not sure how PyWhat should use them after tho. Merged them back into one with |
or search with each regex separately. Probably the latter.
I hope this clears some things. Maybe @bee-san has some more suggestions. :)
{
"Name": "TryHackMe Flag Format",
"Regex": ["(?i)^thm{.*}$", "(?i)^tryhackme{.*}$"],
"plural_name": false,
"Description": "Used for Capture The Flags at https://tryhackme.com",
"Rarity": 1,
"URL": null,
"Tags": [
"CTF Flag"
],
"Examples": {
"Valid": [
"thm{hello}"
],
"Invalid": []
}
}
from pywhat.
Related Issues (20)
- Lat / Long matches incorrectly HOT 6
- Improve tests HOT 10
- Amazon Web Services EC2 Instance identifier matches incorrectly HOT 2
- IPv6 regex matches on "::" HOT 7
- Make a test that tests whether the names of Regex are capitalised HOT 2
- JSON Web Token (JWT) matches incorrectly HOT 1
- duplicate entries in `regex.json` HOT 3
- CI Checks fail HOT 3
- Datadog API Key matches incorrectly
- Discussion about pywhat output order and usability of given matches HOT 3
- [Proposal] Interactive Mode for the user, an interface of the future HOT 1
- [Proposal] parse timestamps HOT 5
- [Proposal] Rarity score from RegEx HOT 2
- Bitcoin Wallet Address matches incorrectly
- Phone Number matches incorrectly HOT 4
- Google API Key
- regex URL does not fully match every URL
- Passed tags are not valid for example invocation from --help string
- Youtube links are not parsed correctly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pywhat.