0

我今天的问题是下一个:我必须从某些内容中减去图像标签“< img src='path />'”,在得到它之后,我必须减去 src 属性并将其保存在变量中,然后将其替换为一个php代码

这个规则在 php 中很容易,但在 freemarker 中很奇怪.. 请有人知道这样做

谢谢你 !!

4

1 回答 1

0

The ?matches built-in will allow you to do regular-expression searches on a given string. It returns a list of substring matches too, so you should be able to get the SRC attribute, put it into a variable, and then build up your PHP code around that.

See the Freemarker manual for details on how to use the built-in:

http://freemarker.sourceforge.net/docs/ref_builtins_string.html#ref_builtin_matches

于 2011-06-22T21:16:49.803 回答