Peter Otten ha scritto:
> TOXiC wrote:
>
> > Hi all, I've this code:
>
> No you don't.
>
!
> > regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*)
> > (\xC6\x44\x24)",re.IGNORECASE)
> > file = open(fileNa
Hi all, I've this code:
regex = re.compile(r"(?si)(\x8B\xF0\x85\xF6)(?P.*)
(\xC6\x44\x24)",re.IGNORECASE)
file = open(fileName, "rb")
for line in file:
if (match):
print line
file.close()
It search a text inside that hex value.
It works perfecly on a txt fi
On 31 Gen, 17:30, "TOXiC" <[EMAIL PROTECTED]> wrote:
> It wont work with utf-8,iso or ascii...
I think the best way is to search hex value in the file stream but I
tryed (in the regex) \hxx but it don't work...
--
http://mail.python.org/mailman/listinfo/python-list
It wont work with utf-8,iso or ascii...
--
http://mail.python.org/mailman/listinfo/python-list
Thx it work perfectly.
If I want to query a file stream?
file = open(fileName, "r")
text = file.read()
file.close()
regex = re.compile(u"(ÿÿ‹ð…öÂ)", re.IGNORECASE)
match = regex.search(text)
if (match):
result = match.group()
print result
WritePatch
Hello everybody.
How I can do a regex match in a string with ascii and non ascii chars
for example:
regex = re.compile(r"(ÿÿ‹ð…öÂty)", re.IGNORECASE)
match = regex.search("ÿÿ‹ð…öÂty")
if match:
result = match.group()
print result
else:
result = "No match fou
Hi everyone,
First I say that I serched and tryed everything but I cannot figure
out how I can do it.
I want to open a a file (not necessary a txt) and find and replace a
string.
I can do it with:
import fileinput, string, sys
fileQuery = "Text.txt"
sourceText = '''SOURCE'''
replaceText = '''REP