B
Bob
Hello:
I could use some regular expression help. I'm trying to create a
client-side javascript function that will test user input to determine
the markup of text that has been copied into a textarea input field,
then will insert html tags accordingly.
So, the user writes up a document in word that contains instances of
italics, bold, and underline. The user then copies the text of that
document into my textarea field. I am trying to create a function that
will then search through all instances of that markup and insert the
appropriate html tags directly into the textarea field.
My problem is that I cannot find a way in javascript with regexp or
otherwise to test user input for italics, bold, or underline. I found
something similar in a PHP script here:
// Check for Italics text
$Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<span
class="italics">$1</span>',$Text);
But I cannot find a client-side javascript equivalent to this. This
only needs to work in the latest IE, as this is part of an internal
tool to help build HTML emails.
Any help would be appreciated greatly.
Thanks,
Bob
I could use some regular expression help. I'm trying to create a
client-side javascript function that will test user input to determine
the markup of text that has been copied into a textarea input field,
then will insert html tags accordingly.
So, the user writes up a document in word that contains instances of
italics, bold, and underline. The user then copies the text of that
document into my textarea field. I am trying to create a function that
will then search through all instances of that markup and insert the
appropriate html tags directly into the textarea field.
My problem is that I cannot find a way in javascript with regexp or
otherwise to test user input for italics, bold, or underline. I found
something similar in a PHP script here:
// Check for Italics text
$Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<span
class="italics">$1</span>',$Text);
But I cannot find a client-side javascript equivalent to this. This
only needs to work in the latest IE, as this is part of an internal
tool to help build HTML emails.
Any help would be appreciated greatly.
Thanks,
Bob