I'm attempting to limit the length of a displayed string to the first 50 characters plus any needed to end at the next word boundary. I'm using the regex_replace filter in the template tag to replace all the characters after the pattern match with "...". However, using the positive lookbehind requires the less-than symbol which apparently MT is interpreting as the start of a tag. This is causing nearby tags to break and the template fails to publish, reporting an error. It there any way to incorporate the positive lookbehind into the template?
<mt:Ignore>Limit entryTitle length by discarding any/all chars after whole word containing 50th char</mt:Ignore>
<mt:entryTitle regex_replace="/((?<=.{50}\b).+)/i","...">
This is an XML problem: The "<" character is illegal within a tag. Encode it as <
:
<mt:entryTitle regex_replace="/((?<=.{50}\b).+)/i","...">
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.