E
E
Enc12020-04-30 18:56:47
Regular Expressions
Enc1, 2020-04-30 18:56:47

How can I write a regular expression to contain characters other than letters, numbers, dashes/hyphens, and spaces?

I try this not regexp_like(test, '[^-0-9A-Za-zA-Yaa-i\s$]')
but the desired effect is not obtained.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
galaxy, 2020-04-30
@galaxy

[^-0-9A-Za-zA-Yaa-z\s$] - this will sweep everything except the characters after the ^ (including the $! character). It is enough to have one such character per line!
If you wanted the entire string to be "characters other than letters, numbers, dashes/hyphens, and spaces", then something like this:
regexp_like(test, '^[^-0-9A-Za-zА-Яа-я\s]+$')

T
Timur Pokrovsky, 2020-04-30
@Makaroshka007

[^\w\d\s-]

X
xmoonlight, 2020-04-30
@xmoonlight

Remove not and $.
Take the expression in slash brackets: /..../g

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question