The following matches in Idle, but do not match when run in a method in a module file:
import re
re.search('\\bשלום\\b','שלום עולם',re.UNICODE)
while the following matches in both cases:
import re
re.search('שלום','שלום עולם',re.UNICODE)
(Please note that stackoverflow mistakenly switches the first and second elements in the line above, since this is the right to the left language)
How can I execute the first code in a py file?
Update. What I had to write for the first segment is that it matches Idle, but does not match when launched in the eclipse console with PyDev.
source
share