Home > Software design >  Why unicode word is not matching but english word will match with my regex
Why unicode word is not matching but english word will match with my regex

Time:08-03

Hi i'm trying to match the any give word if

  1. if it begins with (same letters)
  2. exact match (exact word)

My regex is something like this

/(?<=[(["]\s*|\b)(टीम\w*|UAE\w*|afri\w*)(?=\b|\s*[\])"])/igm

which works for english words but fails with hindi words

Note: my expectation is to match both english and hindi

Here is what i have tried Regex101.com

Problem: my pattern is matching english words perfectly but not matching this hindi word टीम

CodePudding user response:

I managed to come up with something:

(?<=[(["\s]|^)((टीम|UAE|afri)[^\]\s)"]*)

Please tell me if there are cases missed.

  • Related