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
Filtering the SSRS report based on multivalue multiple parameters passed to stored procedure
sharing permission in Windows2003
Backup power
SSH console: go to specified folder after login
Delete query (sql)
Php 500 internal server error received on website but not using xampp at home
How do I use SFTP through a proxy server
Can't Remote Desktop to Forefront TMG Server
If home page add this script
Transfer XP Pro client membership from workgroup to Domain