Home > front end >  How to split Unicode string in non-Alphanumeric characters with regular expression?
How to split Unicode string in non-Alphanumeric characters with regular expression?

Time:12-27

I want to split a string that contains unicode words on non_Alphanumeric characters such as space, CRLF and etc.

For example:

AStr := 'امین Bob(Alice)';

I'm looking for a regular expression to split AStr into a list of below:

امین
Bob
Alice

CodePudding user response:

After reading Regex Tutorial - Unicode Characters and Properties: Unicode Categories I realized that the answer is:

AnArray := TRegEx.Split(ADataStr, '[^\p{L}\p{N}] ');
  • Related