1

I have one field Long text in which I have to escape HTML tags, I am able to escape HTML tags using REGEX but problem is if Content in field has gretaer than(<) character , this charcter is also getting escaped.

for Eg: String str='
Number a < 5' Output:Number a

regex function which I am using is: <.?> I tried using below Regex function also but couldnot solve the problem. <.?\>

  • What are you trying to cleanse? This is a super complicated issue that can require several regular expressions. You're likely better off handling this differently. – drakored Dec 30 '14 at 15:06
  • I have to replace HTML tags in a string – Priya Dec 31 '14 at 4:11
  • Specific tags or all tags? – drakored Dec 31 '14 at 4:13
  • All HTML Tags. <.*?> using this regex I am able to hide HTML tags, but if Content in field has greater than(<) character , this character is also getting escaped. – Priya Dec 31 '14 at 4:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.