Concatenate RTF files in PHP (REGEX)

后端 未结 2 426
离开以前
离开以前 2021-01-23 01:19

I\'ve got a script that takes a user uploaded RTF document and merges in some person data into the letter (name, address, etc), and does this for multiple people. I merge the le

2条回答
  •  梦谈多话
    2021-01-23 01:30

    I would question the use of RTF in this case. It's not entirely clear to me what you're trying to do overall, so I can't necessarily suggest anything better, but if you can try to explain your project more broadly, maybe I can help.

    If this is really the way you want to go though, this regex gave me the correct output given your input:

    $output = preg_replace("/}\s?\n\\\\page.*?\\\\par\s?\n/ms", "\\page\n", $input);
    

提交回复
热议问题