Comments (2)
Hi, yes it‘s in development. I‘m on vacation in the moment, I‘ll look into this next week ☀️
from simplematch.
Enjoy your vacation! ☀️🏝
For when you are back:
I must admit that in your absence I have experimented uncontrollably, and have now implemented some things, some of which can be turned into PRs depending on where you see this package going:
+
(any one character),?
(maybe one character) and|
(either, can be characters or groups). These can be escaped like this{+}
to match the literal "+" character. With this, you can express e.g. "1-3 characters" with+??
. More power could be added by combining these with groups, but have not tried that yet.- Unnamed groups can be typed:
{:int}
- Always return a tweaked dict that has the unnamed groups stored as a list in an attribute called
unnamed
instead of in the dict. This makes them easier to iterate over. The tweaked dict also defines itself as True or False based on whether there were matches, not based on if any groups were found, and there is no need to check for None because the object (as a dict) and theunnamed
list are always there, even if potentially empty. - As an alternative to
match
, added asearch
method that returns a list of match dicts instead of the single dict. - As a final insult, I experimented with using
[]
instead of{}
, because brackets are easier to write on a Nordic keyboard, look less cryptic in the pattern, and because they make it much easier to combine patterns with f-strings.
from simplematch.
Related Issues (3)
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 simplematch.