开发者

How to match only complete words in Oracle regexes? [duplicate]

开发者 https://www.devze.com 2023-03-31 17:11 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Regex to remove blacklisted words from a sentence
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Regex to remove blacklisted words from a sentence

How can I use a regex in Oracle to filter out a list of blacklisted (obscene) words, such that if a blacklisted words is like 'Bill Joseph'

Then 'I am Bill Josephine' is valid

but 'I am Bill Joseph.' is invalid

'I am Bill Joseph,' is invalid

'I am Bill Joseph ' invalid

'I am Bill Joseph<any non alphanumeric>' is invalid.

Similarly 'I am .Bill Joseph' is invalid

'I am <any non alphanumeric>Bill Joseph开发者_如何学运维' is invalid.


What you're looking for is the word-boundary operator:

\bBill Joseph\b
0

精彩评论

暂无评论...
验证码 换一张
取 消