I created a html textarea with a capability to add "[" and "]" at the beginning and end of whatever text has been entered within that.
My problem is, when I enter some multiline data into the textarea, the regex is handled differently in ff and ie.
Input:
Iam
learning
regex
Expected Output: (I get this in FF )
[Iam]
[learning]
[regex]
Output in IE:
[Iam
][]
[learning
][]
[regex]
The Regex code is here:
(textareaIDelement.value).replace(/(^)(.*)(\n{0,})($)/gm, "[" + "$2" +"]");
I added the (\n{0,})
in the regex to match newlines.. but it doesn't have any effect..
Thanks