instaparse

ghaskins 2022-02-02T18:39:35.678579Z

Hi All, I’m trying to understand a failure related to trying to exclude ā€œ[ā€ via regex negation

ghaskins 2022-02-02T18:39:55.445729Z

this grammar snippet

<unquoted-literal> ::= #"[^()\[\s]+"

ghaskins 2022-02-02T18:40:16.896369Z

triggers insta/failure? to return true but there is no info provided

ghaskins 2022-02-02T18:40:28.112379Z

this works

ghaskins 2022-02-02T18:40:29.318159Z

<unquoted-literal> ::= #"[^()\s]+"

ghaskins 2022-02-02T18:40:55.151349Z

and it seems to be fine from a clojure/jvm regex perspective

ghaskins 2022-02-02T18:40:56.477049Z

(re-find #"[^\[]+" "[foo]")
=> "foo]"
(re-find #"[^()\[]+" "[foo]")
=> "foo]"
(re-find #"[^()\[\s]+" "[ foo]")
=> "foo]"

ghaskins 2022-02-02T18:41:56.644559Z

(im totally open to other/better ways to parse this outside of regex, too

ghaskins 2022-02-02T18:42:23.912339Z

any help appreciated

ghaskins 2022-02-02T18:47:26.033169Z

nm, i figured it out