I don't think so. IIRC, JS regex doesn't support negative lookaheads and lookbehinds, which are really my only idea. Sorry.
--Ben Claude Schneegans wrote: > Hi, > > I have a piece of text containing HTML code. > I want to replace (in Javascript) what matches a RegExp, but NOT if the > match is inside an HTML tag. > Is it possible without slicing the text into pure text and HTML parts? > > For instance: > replace (/"([^"]*?)"/, "« $1 »") > replaces "quoted text" with « quoted text » > But it should not replace > <TD width="100"> > with <TD width=« 100 »> > > Any hint? > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:21:924 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
