enso-org / enso

Enso Analytics is a self-service data prep and analysis platform designed for data teams.
https://ensoanalytics.com
Apache License 2.0
7.37k stars 323 forks source link

Support Regex Literal Syntax #7391

Open jdunkerley opened 1 year ago

jdunkerley commented 1 year ago

We want to support JavaScript style regular expression with the expression between /s.

For example,/^Hello World$/ It needs to support escaping / with a \.

kazcw commented 1 year ago

JS doesn't allow division without a numerator. I am having a hard time seeing how in Enso we would lexically distinguish this syntax from operator sections.

I don't think we can make all these work as I would expect they should at the same time:

match_some_words_surrounded_by_spaces = / hello world /
add_half_foo_to_reciprocal_bar = / 2 + 1 /

my_favorite_math_functions = [ /2, +1, 1/ ]
match_some_comma_separated_numbers = /2, +1, 1/