0

I am new to velocity template. I am using velocity template to parse the data in xml format. Using below code to fetch userId: $esc.xml("$!userDetails.userId).replaceAll("&#[0-9a-fA-F]+;","")

Generated output: [ABC123] Excepted output: ABC123

Can someone please help me here. Also, I googled for apache velocity wiki but didn't find one. Also, it would be better if provide some wiki to fetch more information.

Thanks in advance!!

Amit Kumar
  • 377
  • 4
  • 17

1 Answers1

0

Escape [] characters which are regular expression keywords

.replaceAll("&#\[0-9a-fA-F\]+;","")
Ori Marko
  • 56,308
  • 23
  • 131
  • 233