non:256 alph:!1+non nul:(#alph)#,!0 final: {(#x)-1} step: { v:nul n:,/x v[n]:(#n)#,!1 v} branch: { v:nul v[non]:,/x ,v} re: { len: #x seg: +\1,len nxt: 2+!len nxt[final x]: seg[1] branch[1],(nxt+step'_ic x),,nul} / given list of regular expressions, find re which will match any one of those or: { m: -1 _ n:+\1,#:'x; e:-1+#:'x; E:n[#x] branch[m],(,/m+x+(E-e+m)*x=e),,nul} maybe: {branch[1,#x],1+x} seq: { n:-1+#:'x ,/(+\0,n)+(n,1)#'(x,,,nul)} rep: {x[,(#x)-1;non],: ,0, #x; x,,nul} comb: {?y,,//x@y} tc: {comb[x;]'/x} fix: {comb[tc x[;non];]''x} next: {?,/x[y;z]} match: {|/(final x)=next[x]/[x[0;non];_ic y]} without: {x[&(#y)=y?/:x]} Shrink: { d: 0=#:'x[;non] n: +\d N: -1+(?n)?/:n t: +N[without[;&~d]''x[&d;!non]] m: ?t s: x[0;non] (N[s[&d[s]]];(m?/:t);m)} Next: {?,/x[z;y]} Match: {|/(final[*x[2]])=Next[x[2]]/[x[0];x[1]_ic y]} / test num: rep[re[,"0123456789"]] sign: maybe[re[,"+-"]] FP: seq[(sign;num;maybe[seq[(re[,"."];num)]];maybe[seq[(re[,"Ee"];sign;num)]])] fp: fix FP / fp[;256,_ic " 1-e"]