Here's my regex ^([\\p{L}-|a-zA-Z0-9-_]+)$ and it is supposed to allow all foreign letters as well as numeric letter, number. But for some reason, hindi characters cannot match.
I wrote a Xunit test to prove.
[Fact]
public void test()
{
var hindiChar = "इम्तहान";
var input = "12345ABCDPrüfungテスト中文테스트إسرائيل" + hindiChar;
var regex = "^([\\p{L}-|a-zA-Z0-9-_]+)$";
Assert.True(new Regex(regex).IsMatch(input));
}
If you remove the hindiChar, the test will return true; but if you add the hindiChar, the test will return false.
I thought part of the regex is to fit all foreign characters, but not sure why it doesn't match hindi characters.