Closed testcocoon closed 6 months ago
sadly the first number appearing after "code" keyword is 200, which prevent the pattern from detecting the actual code
I can't change the pattern to fix this, as current requirement is that the first number after the sensitive keyword to be the code
You could extend the pattern to not consider the numbers followed by a currency symbol. Something like this regularly expression: code([a-z ]|([0-9.,] (EUR|USD))[0-9]
well I like the suggestion, but I can't execute it I invite you to help if you have the time try to make the required changes to the app's regex (without causing the tests to fail): https://regex101.com/r/ux6Kaz/1
part of the problem is that the app regex also takes a-zA-Z into account for codes, so it's not that simple
I will try to make a suggestion on regexp. I can then create a pull request. The only problem is that I cannot build your code. So I will validate the regex online and put it in the code directly. You will then need to review it.
I have added the following pattern:
| ?[0-9,.]+ ?(EUR|[$€]|USD)
It ignores its number followed by EUR, USB $ or €.
I have added it to the list of items to ignore. See the picture (part highlighted in yellow):
sadly while it works in ecmascript version of the regex, it does not work in java adding the change breaks all cases, and it doesn't even detect the code in the case it is trying to solve
I'm still open to changing it if you did manage to find one that works and doesn't break other cases
well I managed to change the pattern to detect this as well
The following OTP from SMS are not recognised:
Le code à saisir pour votre achat de 200,00 EUR est 29444635. Ne donnez ce code à personne. Si vous n'avez pas réalisé cet achat, appelez le 09.69.32.00.04.
29444635 is the OTP.