Microsoft
Software
Hardware
Network
Question : Limit output length of a regular expression
Hi,
I would like todo the following
<cfset content = rereplace(content,'<p>([^<
]{50,10000
})<','<p>#
left("\1",
50)#<','al
l')>
or for none coldfusion programmers:
var myArray = str.replace(/<p>([^<]{50,1
0000})</gi
,"$1{50}")
The idea is to limit the length of text inside the <p></p> tag if it is longer the 50 characters. Unfortunately the script above does not work.
Well hope anyone can help
Answer : Limit output length of a regular expression
I guess in hindsight (or looking back @ _agx_'s comment) the lookahead is not needed.
1:
<cfset content = rereplace(content,'<p>([^<]{50})[^<]{1,}','<p>\1<','all')>
Random Solutions
WiFi / wireless connection dropped & laptops need to be rebooted to reconnect to 2Wire broadband modem : Event id 5005
New Windows 7 workstations in existing SBS 2003 domain
ASP.NET unable to cast object of type
Create folder / Start Menu Programs Shortcut / Set permissions
Installing RPM on Linux
Anyone used OEM for monitoring PeopleSoft application and peoplesoft databases?
Inkjet printer recommendation for the home wanted
Debian (Xebian) Linux FBSet: How to adjust image?
Exchange Calendar
VMWare VirtualCenter Server Service (vCenter) not starting on startup