I want to add space between Persian number and Persian letter like this:
"سعید123" convert to "سعید 123"
Java code of this procedure is like below.
str.replaceAll("(?<=\\p{IsDigit})(?=\\p{IsAlphabetic})", " ").
But I can't find any python solution.
There is a short regex which you may rely on to match boundary between letters and digits (in any language):
Live demo
Breakdown:
\dMatch a digit(?=[^_\d\W])Preceding a letter from a language|Or[^_\d\W]Match a letter from a language(?=\d)Preceding a digitPython:
But according to this answer, this is the right way to accomplish this task: