With the following code, I am getting different values of indices in my mac and on ubuntu. Both are 64-bit machines and running python 2.7.8. The messages.json file has a string which has some utf-8 characters in the begining. The content of the file is:
#Bangalore fine dinning table bookings in best price ⚡⚡⚡⚡⚡⚡⚡⚡⚡
The python code is as follows:
import re
f = open('messages.json', 'r')
text = f.read().decode('UTF-8')
f.close()
print type(text)
for m in re.finditer('#Bangalore', text):
s = m.start()
e = m.end()
print s, e
print text[s:e]
On Ubuntu:
<type 'unicode'>
11 21
#Bangalore
On Mac:
<type 'unicode'>
20 30
#Bangalore