0

What I need to achieve is the following: I have a few regular expressions to recognize an invoice ID (e.g. fac?tura \w*), which works but I would actually like to get rid of the word "factura" or "fatura" in the result. Can this be done with 100% regex?

I know there are a lot of similar questions around but the vast majority make use of JS's replace method or similar ones for other languages. I do not have this option.

Andra
  • 31
  • 4
  • Yes, capture the ID, `fac?tura (\w*)`, or use a lookbehind like `(?<=fac?tura )\w*`, `(?<=fatura |factura )\w*` or even `(?:(?<=factura )|(?<=fatura ))\w*` – Wiktor Stribiżew Oct 24 '22 at 09:00

0 Answers0