Open jared-hughes opened 6 years ago
I suggest making œṠ
to act more likey
, i.e. [x1, x2, x3, x4]
would substitute x1
with x2
and x3
with x4
, with earlier matches having priority.
A few issues:
I'm currently unable to test this because line 1 of jelly.py changed both on master and here. I think that could be resolved by re-adding parser
, but I'll see if I can resolve the conflicts in another way.
Many of new the atoms returns str
. Jelly doesn't have a string type, so this is bound to cause issues. A single str
can be cast to list
.
œR
returns bool
, which is another type Jelly doesn't have.
œF
: Regex Findall: Find all instances of regexx
in stringy
; return a list of matchesœḞ
: Regex Finditer: Find all instances of regexx
in stringy
; return a list of lists of groupsœṠ
: Regex Sub: Take arguments substitution configuration[x1,x2]
and y. Substitute all instances of regexx1
with replacement stringx2
in stringy
.œR
: Regex Search: Give a boolean denoting if regexx
matches stringy
in any position.œṢ
: Regex Split: Split stringy
at occurrences of regexx
.ÐR
: Regex sub quick:<regex><sub>ÐR
replaces all occurrences of<regex>
with<sub>
applied to each occurrence’s list of groups and spanSome possible issues:
œṠ
is given a left argument/configuration which is a string, it substitutes all instances of the first character of the string with the second character of the string in the right argument, which is the same as atomy
.ÐR
usesto_string(x) = ''.join(x) if is_string(x) else str(x)
to cast the output of<sub>
to string. Not sure if there is a better casting method.