javascript - Equivalent word boundary regex for unicode characters -


this question has answer here:

i'm trying match given word (in case, in greek). word boundary \b won't work here, have this:

/(?:[\s;.,!?:-_]?)(αυτοκίνητο)(?:[\s.,!?:-_]|$)/gi 

the problem still match here:

aaa ααυτοκίνητο aaaa (notice repeated α)

if remove optional ?, not match:

αυτοκίνητο aaaa

any suggestions?

demo

(?:^|(?:[ ;.,!?:-_]))(αυτοκίνητο)(?:[\s.,!?:-_]|$) 

you need remove ? first group.see demo.

https://regex101.com/r/ss2dm8/2


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -