Power Query regex example from http://www.thebiccountant.com/2018/04/25/regex-in-power-bi-and-power-query-in-excel-with-java-script/
✓ Published0🌍 Public
HHugoberry
Last edited Apr 25, 2018
Created on Apr 25, 2018
This example demonstrates how to extract numeric patterns from a mixed-language string using regular expressions within Power Query. It defines a custom function that invokes JavaScript’s `RegExp` and `String.match` via the `Web.Page` HTML/JavaScript execution environment, passing a target string and a regex pattern. The specific call extracts all digit sequences from “hello012中国1235” and returns them as a list. This approach highlights Power Query’s ability to leverage external scripting for text processing, bridging M’s native functions with JavaScript’s regex engine for advanced pattern matching.
AI-generated description