Support for regex and `=~` operator
Ouverte
compiler
- Langage dominant
- Rust
- Étoiles
- 5.2k
- Forks
- 145
- Merge moyen
- 5 j 3 h
- PR mergées (30 j)
- 7
Description
Bash example:
```bash
line=" aaaaaab"
pattern="[[:space:]]*(a)?b"
if [[ $line =~ $pattern ]]; then
echo "Matches"
fi
```
Source: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Conditional-Constructs
Is there a way or plan to implement this with Amber?
The following code:
```amber
main (args) {
let line = " aaaaaab"
let pattern = "[[:space:]]*(a)?b"
if line =~ pattern {
echo "Matches"
}
}
```
Does not compile:
```stdout
ERROR
Identifier 'if' is a reserved keyword
at example.ab:6:3
5|
6| if text =~ pattern {
7| echo "Matches"
```
Using Amber 0.3.3-alpha
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.