[pmwiki-devel] FW: $12.50 -> .50 var problem
The Editor
editor at fast.st
Tue Apr 10 15:12:24 CDT 2007
On 4/10/07, J. Meijer <commentgg at hotmail.com> wrote:
>
> Jason is right.
>
> $v = preg_replace('/\$[0-9]/', '\\\\$0', $v);
>
> Should work. $12 to him.
>
> To also protect against \\12.50in your data the best I can do is follows.
Are you saying the preg_quote command will corrumpt the above data?
> if (strpos($newpage['text'], "(:$ff: ") !== false) # not needed at all,
> complicates your code (Kathryn is your friend)
> $newpage['text'] = preg_replace("/\\(:$ff: (.*?):\\)/s", "(:$ff: $v:)",
> $newpage['text'], 1);
actually I need the if because the next line is an else that depends
on the condition failing. Just the same, Kathryn has indeed been a
big help...
Cheers,
Dan
More information about the pmwiki-devel
mailing list