-1

0

How to find invoice number from different companies which may have different order of invoice number, unit cost and total cost?

Following is specific example of a company XYZ which I need to get 1234545

This is invoice from company XYZ - 1234545 product name , product number 444456, information invoice unit cost $12.0 and invoice total $1343.00

Another company may have following invoice This is invoice from company ABC - 1234545 product name and information invoice total cost $6777 and invoice unit cost $654

Apple Numbers do not allow \K which is PCRE answer XYZ.*?\K\d+

2
  • What is “Apple Numbers”?
    – Toto
    Commented Jun 13 at 9:43
  • @Toto kind of Excel for Mac
    – Destroy666
    Commented Jun 14 at 15:19

1 Answer 1

0
XYZ.*?(\d+)
  • Dot . Matches any character except line breaks.
  • * Quantifier. Match 0 or more of the preceding token.
  • ? Lazy. Makes the preceding quantifier lazy, causing it to match as few characters as possible.
  • ( Capturing group #1. Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference
  • \d Digit. Matches any digit character (0-9).
  • + Quantifier. Match 1 or more of the preceding token.#regex

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .