#regex not working

12 messages · Page 1 of 1 (latest)

unkempt pagoda
#

I'm trying to hide all stone items and I'm using regex to select them but it's not working.

global.stone = [
    [/minecraft:.*(?>!sand|red|drip|glow|grind).*stone(?!cutter)/, /minecraft:.*(granite|diorite|andesite|tuff|calcite)/, /.*deepslate(?!.*ore)/]
]```
It gives me this error when I restart the game:
`dev.latvian.mods.rhino.EcmaError: SyntaxError: Invalid quantifier ?`


(Just to note the code hiding the items work its the code above that errors)
still tinselBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

upbeat spindle
#

As it says on the tin - whatever quantifier you are using isn't recognized by Rhino

#

And isn't supported by ECMAScript at all

#

What did you use to create the regex?

unkempt pagoda
upbeat spindle
#

Whatever you used in your regex isn't a lookbehind assertion

unkempt pagoda
#

I'm confused why it isn't counting as a lookbehind assertion, I copied the syntax from there and replaced the placeholder parameters

upbeat spindle
#

?>!
This isn't a lookbehind assertion

#

See that the > is wrong way?

#

Lookbehind assertion is ?<!

unkempt pagoda
#

ty!