Comments (10)
hm... what about opposite
I'm running all of the Bash tests I was able to find - the table above lists the only patterns that extglob disagrees with bash on. Unfortunately the nuances of bash extglob don't seem to be consistent with regex - unless we can find a real specification, with sufficient detail to determine correct matching behavior, we'll just have to go with our best guess on some of these.
from extglob.
I think I am pretty much agreement with everyone. extglob's behavior seems to be less surprising. Make sure to note the differences in the readme, of course.
from extglob.
Make sure to note the differences in the readme, of course
good call. I might have forgotten to do that thx
from extglob.
moo.cow
!(*.*).!(*.*)
I'm agree with Bash to be true
, it make sense.
foo.js.js
*.!(js)
and
foo.js.js
*.!(js)*
I'm agree with Bash and seeing his the point to return true, but I'm curious what Bash says for *.!(js.)
?
edit: maybe outer have precedence than inner here
foo
*(!(foo))
hm... what about opposite: !(*(foo))
?
In most cases I'm agree with extglob
lib more than Bash.
from extglob.
The patterns themselves are pretty bizarre and basically contradict themselves. Based on the chart I'd think extglob's behavior is more in line with what users would expect if they actually used these sorts of combinations, and I also think that when the pattern is odd/ambiguous it's better to "fail closed" and lean toward false
when in doubt - so extglob still wins.
I suppose I could understand Bash's reasoning on some of these - particularly those with a trailing *
(but at that point should a trailing *
just trump absolutely anything else specified in the pattern?) - but a few I'm really struggling to understand how a match could be considered correct behavior.
Stellar work here @jonschlinkert
from extglob.
thanks for the feedback @es128!
I also think that when the pattern is odd/ambiguous it's better to "fail closed" and lean toward false when in doubt
yeah that's pretty similar to what I was thinking
from extglob.
Yea, why not? Let's go with that agreement and if there so many users that are surprised in future, things can be done more strict and to stick more to Bash.
extglob's behavior is more in line with what users would expect if they actually used these sorts of combinations
Absolutely.
from extglob.
meaning you agree?
from extglob.
Yep, I don't have problems with most of them.
from extglob.
closing, I think this is resolved
from extglob.
Related Issues (6)
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 extglob.