Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
170
rated 0 times [  172] [ 2]  / answers: 1 / hits: 24195  / 10 Years ago, wed, october 1, 2014, 12:00:00

I need a regular expression that replaces the greater than and less than symbol on a string



i already tried



var regEx = s/</</g;s/>/>/g
var testString = <test>
alert(testString.replace(regEx,*))


My first time to use it please go easy on me :)
Thanks


More From » jquery

 Answers
35

You can use regEx | like



var regEx = /<|>/g;
var testString = <test>
alert(testString.replace(regEx,*))


Fiddle


[#69279] Sunday, September 28, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amari

Total Points: 736
Total Questions: 111
Total Answers: 90

Location: Saint Pierre and Miquelon
Member since Fri, Jan 28, 2022
2 Years ago
;