Link to home
Start Free TrialLog in
Avatar of Pedro Chagas
Pedro ChagasFlag for Portugal

asked on

Javascript Regular Expressions - jQuery highlightTextarea

Hi E's, I'm developing a kind of html editor in a textarea (WYSIWYG), and adapted a plugin for highlight, this one: jQuery highlightTextArea, and I need help to create some regular expressions for javascript, like this: example from plugin website.
I can Insert two tags in my WYSIWYG, one for insert image, and other to insert youtube videos:
<img src="the_image.jpg" style="display: block; margin-left: 0px; margin-right: auto; padding: 15px 15px 15px 15px;" class="img-responsive" alt="the alt tag" width="640" height="480">

Open in new window

<div class="video-container"><iframe src="http://www.youtube.com/embed/m-ijfwr4SzI" frameborder="0" width="560" height="315"></iframe></div>

Open in new window

To get the tags highlight, I need a regular expression for highlight that two lines (image and video).
How I do that?

The best regards, JC
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Why not just use the industry standard that millions of WordPress web sites have already debugged for us?  Have a look at TinyMCE.  It's amazingly easy to use.  You can have it configured and running in minutes.
Avatar of Pedro Chagas

ASKER

Thank you @Ray.
Before I begin the adventure of construct my own editor, I explore lots of alternatives, and none of these html editors served for my very specific needs, for this reason I had to do my own editor, and the editor in order to complete and proceed with my project, I just need to know a part of the regular expressions.
I confess I did not know TinyMCE, sure it will be an excellent alternative for future projects.

~JC
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial