Manipulating bullet list ul tag using Regex or something else

2007-07-19 Thread Jide Aliu
Hi,

Is it possible to wrap a p tag round bullet list like the examplme below, 
amongst a massive chunk of data, basically wherever the function or regex finds 
an opening and closed ul tag it wraps an opening and closing p tag rounds 
it:
p
ul
  liFirst line/li
  liFirst line/li
  liFirst line/li
  liFirst line/li
/ul
/p

Many thanks



~|
Macromedia ColdFusion MX7
Upgrade to MX7  experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284060
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Manipulating bullet list ul tag using Regex or something else

2007-07-19 Thread Jochem van Dieten
Jide Aliu wrote:
 
 Is it possible to wrap a p tag round bullet list like the examplme below, 
 amongst a massive chunk of data, basically wherever the function or regex 
 finds an opening and closed ul tag it wraps an opening and closing p tag 
 rounds it:

You don't even need a regex for that, just use two regular replace 
operations:
ReplaceNocase(ReplaceNocase(text, /ul, /ulp, All, ul, 
pul, All)

Jochem

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2  MX7 integration  create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284061
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Manipulating bullet list lt;ulgt; tag using Regex or something else

2007-07-19 Thread Jide Aliu
Off course!! thanks a million.
 Hi,
 
 Is it possible to wrap a p tag round bullet list like the examplme 
 below, amongst a massive chunk of data, basically wherever the 
 function or regex finds an opening and closed ul tag it wraps an 
 opening and closing p tag rounds it:
 p
 ul
  
 liFirst line/li
  
 liFirst line/li
  
 liFirst line/li
  
 liFirst line/li
 /ul
 /p
 
 Many thanks
 

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2  MX7 integration  create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284065
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Manipulating bullet list ul tag using Regex or something else

2007-07-19 Thread Ben Doom
As long as you can guarantee that you won't have nested lists, it's 
pretty easy.

rereplacenocase(string, (ul.*?/ul), p#1#\p, all)

Not tested, from memory, YMMV, keep head and arms inside the regex at 
all times.  And I've done backreferencing in 3 languages since doing it 
in CF.  I think the #1# is right, but I could be wrong about that.

--Ben Regex Ninja Doom

Jide Aliu wrote:
 Hi,
 
 Is it possible to wrap a p tag round bullet list like the examplme below, 
 amongst a massive chunk of data, basically wherever the function or regex 
 finds an opening and closed ul tag it wraps an opening and closing p tag 
 rounds it:
 p
 ul
   liFirst line/li
   liFirst line/li
   liFirst line/li
   liFirst line/li
 /ul
 /p
 
 Many thanks
 
 
 
 

~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284069
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Manipulating bullet list ul tag using Regex or something else

2007-07-19 Thread Ben Doom
Heh.  I gotta stop looking for zebras.  Even if someone shouts Zebra! 
   Yeah, your solution is much more efficient than mine.

--Ben Doom

Jochem van Dieten wrote:
 Jide Aliu wrote:
 Is it possible to wrap a p tag round bullet list like the examplme below, 
 amongst a massive chunk of data, basically wherever the function or regex 
 finds an opening and closed ul tag it wraps an opening and closing p tag 
 rounds it:
 
 You don't even need a regex for that, just use two regular replace 
 operations:
 ReplaceNocase(ReplaceNocase(text, /ul, /ulp, All, ul, 
 pul, All)
 
 Jochem
 
 

~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade  see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284076
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Manipulating bullet list ul tag using Regex or something else

2007-07-19 Thread Dave Francis
Why not just use CSS to style ul (space it with margins or whatever)?

-Original Message-
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 6:40 AM
To: CF-Talk
Subject: Re: Manipulating bullet list ul tag using Regex or something
else


Jide Aliu wrote:

 Is it possible to wrap a p tag round bullet list like the examplme
below, amongst a massive chunk of data, basically wherever the function or
regex finds an opening and closed ul tag it wraps an opening and closing
p tag rounds it:

You don't even need a regex for that, just use two regular replace
operations:
ReplaceNocase(ReplaceNocase(text, /ul, /ulp, All, ul,
pul, All)

Jochem



~|
CF 8 – Scorpio beta now available, 
easily build great internet experiences – Try it now on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284077
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Manipulating bullet list lt;ulgt; tag using Regex or something else

2007-07-19 Thread Jide Aliu
Thanks for all your replies guys, I'm actually putting the tag in an XML 
document, which makes Jochem solution as easy as it is does the job.

~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade  see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284092
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RegEx or something else?

2002-05-29 Thread Ian Lurie

If I am outputting the first n characters of a string to a page, like this:

The quick brown fox jumped over...

And I want to make sure I never get this:

The quick brown fox jumped o

Would I used RegEx? Or something else? What's the easiest way to make sure
that that last bit of the string displayed is a whole word?

Thanks,

Ian

Portent Interactive
Helping clients build customer relationships on the web since 1995
Consulting, design, development, measurement
http://www.portentinteractive.com
Talk with us: http://projects.portentinteractive.com

__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: RegEx or something else?

2002-05-29 Thread Carlisle, Eric

Try something like this.  It's easier to write than to explain :)




cfset myString=The quick brown fox jumped over the lazy dog.
cfset n = 30

cfif not mid(myString,n,1) eq  
cfset n = find( ,myString,n)
/cfif

cfset myString = left(myString,n)

cfoutput#myString#/cfoutput





Good Luck!

Eric


-Original Message-
From: Ian Lurie [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 11:30 AM
To: CF-Talk
Subject: RegEx or something else?


If I am outputting the first n characters of a string to a page, like this:

The quick brown fox jumped over...

And I want to make sure I never get this:

The quick brown fox jumped o

Would I used RegEx? Or something else? What's the easiest way to make sure
that that last bit of the string displayed is a whole word?

Thanks,

Ian

Portent Interactive
Helping clients build customer relationships on the web since 1995
Consulting, design, development, measurement
http://www.portentinteractive.com
Talk with us: http://projects.portentinteractive.com


__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists