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
VBA insert error
Ex2010 - Move Mailbox Failed - Corrupt Messages
How do I write data to separate excel worksheets in coldfusion?
SPContext.Current is returning null in the "SPItemEventReceiver" event handler.
Datareader.Read() does not pull the required rows
Cisco VPN client for Windows, use both RSA SecurID soft token and hard token
In Perl, how do I check if a value already exist in the database
Is there a tool to check to see who has enabled auto-forward in outlook
how to delete partial contents of a cell?
How do i download my dreamweaver site to a different computer than the one I uploaded it on?