Regular expression (non-English)

I checked: localhost - works (As well as: а-я, p{Cyrillic} …)
But the test showed:

term.gsub!(/[^a-z0-9\p{Alnum}\.\-\_]*/, '')
All checks have failed

Strangely (Although it already includes both letters and numbers)
delete
- a-z0-9

Can you make a correction yourself?
This bug is initially there, and working with tags is an important part.

P.S. term.gsub!(/[^\p{Alnum}\.\-\_]*/, '') - working (All checks have passed)
file: search.rb - does not need correction