Jump to content

Regular expressions in JavaScript: Convert one type of tag to another in string?


ultrus

Recommended Posts

Hello,

I have an odd project where I'm converting HTML from a text editor into SSML to be processed. So far all is good but regex makes my brain explode today.  :o

 

Any thoughts on how to convert something like this:

<span class="rcPitchXHigh" title="pitch: x-high" alt="pitch">blah blah</span>

into this:

<prosody pitch="x-high">blah blah</prosody>

using JavaScript?

 

I was thinking about doing this with PHP eventually, but if I can keep it all on the client side, all the better.

 

Thanks much in advance for any pointers big or small. Let me know if I can provide more advanced examples. I'll fill in the gaps if I figure it out first. :)

 

Best regards,

 

Chris

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.