|
Posted by Andy Hassall on 11/05/05 00:22
On Fri, 04 Nov 2005 09:23:48 GMT, "Mauro D." <mauro.destroSpammmm@tinspam.it>
wrote:
>Hi guys,
>i'm trying to replace a picture inside an RTF file.
>
>I have found that this is the format the picture is described inside RTF:
>
>{\*\shppict{\pict\picscalex80\picscaley80\piccropl0\piccropr0\piccropt0\piccropb0\picw800\pich600\picwgoal12000\pichgoal9000\jpeglib
>...some binary data...}}
>
>RTF file is about 3,9MB and this expression "\{\\*\\shppict{\pict(.*?)}}/"
I'd switch to single quotes around the PHP string to avoid added confusion
with slashes - it's tricky enough already.
Consider for example (which appears in your expression):
"\\s"
The actual value of that string is:
\s
Because the first slash escapes the second in PHP, and the s is a literal
character.
So \s reaches the PCRE engine, which interprets this as "whitespace
character".
Do you want something more like (and I've not quite convinced this is right
either):
'/\{\\*\\\\shppict\\{\\\pict(.*?)}}/'
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|