Forum Discussion

k_mathana's avatar
k_mathana
Helper II
4 years ago
Solved

Extract List of Records from String

Hi Experts, I have one specific requirement to extract number of PO Orders from the strings, the PO orders starts with "OCD" or "COD" and 4 digit number, the users input is free text so we recieve i...
  • k_mathana's avatar
    k_mathana
    4 years ago

     

    Thank you ribisht17 I found the way using RegEx

    let fx=(txt as text, regex as text, delim as text)=>
    Web.Page(
    "<script>
    var x = '" & txt & "';
    var delim = '" & delim & "';
    var pattern = /" & regex & "/gi;
    var result = x.match(pattern).join(delim);
    document.write(result);
    </script>")[Data]{0}[Children]{0}[Children]{1}[Text]{0}
    in
    fx