Okay, then for Cyrillic use: /[\u0400-\u04FF]+/
And for Arabic use: /[\u0600-\u06FF]+/
To block further sets of ASCII characters, have a look there: Public Unicode Character Map.
And to answer your question, yes, your last \
is likely causing an error, and you don’t need the $
either, also I don’t know what the ~
is doing there. Also the i
modifier is to make the comparison case insensitive, so with this parameter you could only have uppercase or lowercase characters instead of the whole set, the modifier you might be looking for is g
, but given the +
I don’t think it’s really necessary.