|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
REGEX to modify href="" of <a> tag
I know my solution to this problem is by using a REGEX, but I am not very good at those, so I was hoping somone could "teach me to fish", so to speak.
I want to pull some text from a database. The text may contain a <a href=""></a> tag in it. What I want to do is pass that text through a function that will replace the href=" with href="#URLSessionFormat(" and of course the ending " with a ")#". Make sense? In other words, I want this text, which is being pulled form a database: <a href="iltcore.cfm?content=articles&id=e91eeac5-d241-4eef-a627-645102f5f809">View This Article</a> Turned into this: <a href="#URLSessionFormat("iltcore.cfm?content=articles&id=e91eeac5-d241-4eef-a627-645102f5f809")#">View This Article</a> I don't need anyone to write the function, just need someone to show me a REReplaceNoCase() I should use... Last edited by MatthewClark : June 8th, 2005 at 06:59 PM. |
|
#2
|
|||
|
|||
|
You can actually do this, I think, without regex at all. Can't you just replace any instance of this:
<a href=" with this: <a href="#URLSessionFormat(' and any instance of this: "> with this: ')#"> ?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
||||
|
||||
|
Yeah, I thought of that. But that assumes the EVERY <a> tag is written exactly the same way every time. It won't allow for a class or taget attribute.
While watching for a reply, I have been toying with regex to try to figure it out on my own. So if I figure it out on my own, I'll certainly share it. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Formatting links with URLSessionFormat() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|