We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Help parsing from html tags

michaelgiaimo
on
Medium Priority
197 Views
Last Modified: 2012-05-11
I have a field, called bodytext, in a MySQL database.  It's a mediumtext field.  In the paragraphs of text there are links scattered, formatted like this:

<link news/single-news-page/article/airbus-opens-a320-line-in-tianjin-18102/ _blank>A320 final assembly</link>

Open in new window


Note the last section of the link (18102).  They're all formatted like that, with the ID last - though not always 5 digits, they start at the low 20's.  

The new link needs to be:
<a href="?q=node/18102">A320 final assembly</a>

Open in new window


Yes, I'm moving from an old CMS into Drupal.
Comment
Watch Question

Author

Commented:
I should add the link isn't the only thing in the field.  I need to keep all surrounding text and just update the link.
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, worked.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.