Comments (6)
plz explain
from pywhat.
Can you please explain more on this issue?
from pywhat.
Can you please explain more on this issue?
Sure! e90963
is not valid latitude / longitude coordinates and it shouldn't match :(
from pywhat.
plz explain
What are you confused about? :)
e90963
is not valid lat / long coordinates as it's only one single item (that's rather small)
from pywhat.
Another example:
Matched on: e26
Name: Latitude & Longitude Coordinates
Link: https://www.google.com/maps/place/e26
from pywhat.
I propose this new one: https://regex101.com/r/WrINyr/1
The old RegEx consists of three patterns:
- Full expression with symbols and prefix N/W/S/E , e.g. N 32° 53.733 W 096° 48.358
(?:(?:N|W|S|E)\\s?\\d+\\s?\\u00B0?\\s?\\d+\\.?\\d*\\s?\\'?\\s?\\d*\\.?\\,?\\d*?\"?\\s?){1,2}
- Full expression with symbols and subfix N/W/S/E, e.g. 13°55'24.3"N 101°20'30.1"E
(?:\\d+\\s?\\u00B0\\s?\\d+\\s?\\'\\s?\\d+\\.?\\,?\\d{0,}?\"\\s?(?:N|W|S|E)\\s?){1,2}
- Two decimal numbers without symbols and prefixs, e.g. 52.6169586, -1.9779857
(?:[-+]?(?:[0-8]?\\d+\\.\\d{4,}|90(?:\\.0+)?),\\s*[-+]?(?:180(?:\\.0+)?|(?:(?:1[0-7]\\d)|(?:[1-9]?\\d))(?:\\.\\d+)?))
Line 1480 in 6162ace
The first pattern slightly differs from the second pattern in the symbol matchings
\\u00B0?
and\\u00B0
\\'?
and\\'
\"?
and\"
This causes the RegEx matching ofe26
,e90963
, and so on.
I've observed that there is nothing like N 52.6169586, W -1.9779857
; only N 32° 53.733 W 096° 48.358, and 52.6169586, -1.9779857 are valid.
Then these symbol matching should've been changed to the strict matching of \\u00B0
, \\'
, and \"
or the flexible matching of \\u00B0
, \\'?
, and \"?
.
If it looks fine, I'll make a patch.
Thanks
from pywhat.
Related Issues (20)
- 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
- Add support for list of regex in regex.json HOT 4
- 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
- URL is not parsed with params 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.