Search notes:

Power Query: Use Web.Page to execute JavaScript to match Regular Expressions

let
   findPattern=(txt, pattern) => Web.Page(
      "<script>
          var re = /" & pattern & "/;
          document.write('" & txt & "'.match(re));
      </script>")[Data]
      {0}[Children]
      {0}[Children]
      {1}[Text]
      {0}
in
   findPattern("hello 42 world", "\d+")

See also

Evaluating JavaScript with Power Query's Web.Page function.

Index