Open mbtools opened 2 years ago
can the example be reduced?
FIND REGEX '(\d\d).*(\d*)' IN `123` SUBMATCHES DATA(p1) DATA(p2).
p1 = '12'. p2 = '3'.
https://regex101.com/r/SMEF5o/1 '12', null https://regex101.com/r/JAjp0V/1 '12', '3'
yea, try adding the lazy star thing, add some unit tests, we'll see if it works out 😄 but probably better than before
but note that https://github.com/abaplint/transpiler/pull/674 probably changes the same file that needs changes
new file for handling ABAP regex specifics, transpiler/packages/runtime/src/abap_regex.ts
ABAP regex is different from PCRE. However, it looks to me that the transpiler uses PCRE regex.
ABAP Example (from Phone Number exercise, which works without errors in ABAP but fails in Exercism):
This works differently in JS
https://regex101.com/r/qhagS7/1
I can make the regex work in JS by using by making the
*
quantifiers lazy (replace by*?
).https://regex101.com/r/ZbSBTv/1
Not sure what's the best way to fix it. Here're the relevant docs:
https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenregex_migrating_posix.htm