Comments (5)
Hmm. I'll have to figure out a good way to handle that. After the regex line-end symbol '$', bish expects there to be a variable name. That's because interpolations in strings are currently handled by prefixing '$' as well. I will need to think on this one a bit.
from bish.
Yes, I also realized that there must be a variable.
Ok, I'll wait.
from bish.
@tdenniston Why not use these quotes `?
from bish.
@eg0r This should work now, for example:
text = "335";
@([[ $text =~ ^[0-9]+\$ ]]);
assert(success());
Seems to work as expected.
from bish.
Wonderful commit. Now you can make functions for type checking:
def is_integer(v) {
@([[ $v =~ ^[0-9]+\$ ]]);
return success();
}
if (is_integer("100")) {
println("Yes!");
} else {
println("No!");
}
# => "Yes!"
from bish.
Related Issues (20)
- Add support for arrays HOT 4
- Version tagging HOT 5
- Implement =~ operator for [[-based regex matching. HOT 1
- Improve type checking error messages
- Iteration of the array elements HOT 5
- error segmentation HOT 4
- Mathematical functions HOT 6
- Invalid argument type for function HOT 2
- Support string manipulation
- Support file globbing HOT 2
- Strange behaviour writing utility functions HOT 6
- bish -r does not work when script requires stdin input to be forwarded
- Unclear error message on syntax error. HOT 1
- next release publish date? HOT 1
- Declarative syntax for autocompletions HOT 1
- never used variable
- Backticks leak into arbitrary command execution HOT 1
- Need to contact
- Guys, it's time to create a some stable fork. HOT 2
- error: dynamic_cast from rvalue to reference type
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 bish.