10

TL;DNR: does excel formulas provide regex-like functionalities for pattern matching?

My task is to extract the numeric values from strings (containing addresses in this specific case). Solving the problem with VBA's regular expressions would be pretty straightforward, but unfortunately I would prefer not to use it.

Does excel formulas provide pattern matching functionalities with similar expressiveness? SEARCH seems to be pretty limited, and in order to work it needs to exploit regularities that, since the text is user-submitted, I can't really rely on.

mercuk
  • 121
  • 1
  • 1
  • 5

1 Answers1

4

There's no regex available in Excel formulas. Your best option is to create a function in VBA and then call it from Excel

Link explaining how to do it.

Kritz
  • 7,099
  • 12
  • 43
  • 73
  • 1
    Actually for very simple regexp you can use combination of RIGHT/FIND/LEN in your formula. see https://superuser.com/questions/821498/is-there-a-way-to-use-regex-or-comparable-solution-in-excel-formulas/821757 but it is quite tedious and not as clean and modulable as VBA. – Christophe Guerrier Jul 28 '17 at 06:45