Hello
I've been discussing with my team the use of the Regex Actions from the Text extension. And I would like to ask the opinion from more experienced people.
We have to import an excel file and one of the columns can bring a cost that depending on the line can bring different currencies (Ex: Project 1 - 100€, Project 2 - 150$, Project 3 - 50000Kz, Project 4 - 2000Zl, Project 5 - 200000 MZM, ...) .
I was using the regex function to remove the Currency symbol, but some members of my team don't like the idea of using the regex and think we should use a list of currency symbols an through a substring remove those symbols.
It works both ways, but which of those options is the best in this situation where we have to remove the currency symbol from the value
Thank you in advance
Samuel Alves
Hi @Samuel Alves,Based on my knowledge,Using regex to remove the currency symbol can be more flexible, as it can handle different variations of the currency symbol (such as €, $, Kz, Zl, MZM, etc.) in a single expression. This means that you don't have to create a separate substring logic for each currency symbol. Additionally, using regex can be faster and more efficient.Using a list of currency symbols and performing a substring operation can be more straightforward and easier to understand for some team members. It also allows for more control over the specific symbols to be removed and can be more predictable in terms of behavior.So using regex may be a better option.I hope this helps!RegardsN_G
Hi Samuel Alves,
https://www.outsystems.com/forums/discussion/55651/remove-special-characters/
Use regex function to remove the Currency symbol like that.
Thanks,
Ramesh
Hi
The best way is the regx only it makes the operetion light weight and easy to understand so my opinion is clear to use there only regex!!!
Good to go with Text extension
kind regards
sourabh Sharma
Regex is far from "light weight", if Index/Substr is an easy option, always go for that (not saying that in this particular case regex is not the best option, but one should use it cautiously).