1

I have this regex code that removes leading and trailing white spaces.

regexreplaceall("^\s+|\s+$", ri!value, "")

However, it only removes halfwidth spaces.

Sample result process:

a) value(consist of half width spaces): " he llo "

   result: "he llo" -> correct

b) value(consist of fullwidth spaces): "  he llo  "

   result: "  he llo  " -> incorrect

Does anyone know whats the regex code for fullwidth spaces? Im Using Appian platform

Thank You everyone!

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
Joshee Joshy
  • 77
  • 2
  • 7

1 Answers1

1

You need to make the \s (and other) shorthand character class Unicode-aware.

Since Appian uses Java regex flavor, all you need is add the (?U) embedded flag option to the pattern:

regexreplaceall("(?U)^\s+|\s+$", ri!value, "")
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563