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
Any idea for adding regular expressions? (given that all implementations of advent of code day #3 where basically just 1 regex :)
J (TIL) has them like this;
F =: +/@([: (3 */@".@}. ])@> 'mul\(\d+,\d+\)' rxall ])
how about
`/mul\((\d+),(\d)+\)`/
which will return a list with matches
so we can do;
+/*/`/mul\((\d+),(\d+)\)`//input
for instance (look ma, no casting; \d already know it's integers obviously)
For ease of implementation, this would obviously also work:
+/*rx["mul\(\(d+),\(d+)\)"]/input
Seems that's the way most other APLs implement it.
I hacked in my own which works well;
https://gist.github.com/tluyben/fc959d7ae821c8864cf13d5af319c81e https://github.com/tluyben/ok
Makes the solution to day 3 indeed as trivial as:
+/{*/x[2]}'rx["mul\((\d+),(\d+)\)";input]
I couldn't figure out how to make it accept arguments to the left that fast (I didn't spend a lot of time), but it works.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Any idea for adding regular expressions? (given that all implementations of advent of code day #3 where basically just 1 regex :)
J (TIL) has them like this;
F =: +/@([: (3 */@".@}. ])@> 'mul\(\d+,\d+\)' rxall ])
how about
which will return a list with matches
so we can do;
for instance (look ma, no casting; \d already know it's integers obviously)
For ease of implementation, this would obviously also work:
Seems that's the way most other APLs implement it.
I hacked in my own which works well;
https://gist.github.com/tluyben/fc959d7ae821c8864cf13d5af319c81e
https://github.com/tluyben/ok
Makes the solution to day 3 indeed as trivial as:
I couldn't figure out how to make it accept arguments to the left that fast (I didn't spend a lot of time), but it works.
The text was updated successfully, but these errors were encountered: