We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Like title says, I found that #break/#return doesn't work as intended when used inside #regexp. Example:
#foreach {{1}{2}{3}{4}{5}{6}} tmp { #regexp {"$tmp"} {"5"} { #break; } { #echo $tmp } }
Output is 1 2 3 4 6 instead of 1 2 3 4.
1 2 3 4 6
1 2 3 4
Is this the way #regexp should be working?
Env: Debian in WSL Windows 10 Tintin: 2.02.05
The text was updated successfully, but these errors were encountered:
As per #help break
The break command can be used inside the #foreach, #loop, #parse, #while and #switch statements.
#regex has its own scope so #break and #return won't work within it.
I'll have to rewrite the scripting engine to handle #regex, which probably won't be anytime soon. You can however use:
#foreach {{1}{2}{3}{4}{5}{6}} tmp { #regexp {"$tmp"} {"{[^5]}"} { #echo $tmp }; #else { #break; } }
Sorry, something went wrong.
As per #help break The break command can be used inside the #foreach, #loop, #parse, #while and #switch statements. #regex has its own scope so #break and #return won't work within it. I'll have to rewrite the scripting engine to handle #regex, which probably won't be anytime soon. You can however use: #foreach {{1}{2}{3}{4}{5}{6}} tmp { #regexp {"$tmp"} {"{[^5]}"} { #echo $tmp }; #else { #break; } }
Yeah, sure, that's what i'm doing now. Thanks for the prompt reply~
No branches or pull requests
Like title says, I found that #break/#return doesn't work as intended when used inside #regexp.
Example:
Output is
1 2 3 4 6
instead of1 2 3 4
.Is this the way #regexp should be working?
Env: Debian in WSL Windows 10
Tintin: 2.02.05
The text was updated successfully, but these errors were encountered: