Forum Discussion
Extract six-digit numbers from text string
- Anonymous2 years ago
Hi Anonymous ,
You can use this regular expression:
let str = ""; let regex = ^[0-9]{6}$; let match = str.match(regex); if (match) { console.log(match); }If this expression still doesn't work with your data you can use this link to automatically generate a regular expression.
You can refer to the following documents to learn how to use regular expressions in power query:
Regular expressions in Power Query – Q-stat
Using regular expressions in power bi desktop - Microsoft Fabric Community
Using Regular Expressions(RegEx) in Power BI | by Shivam Shukla | Medium
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You can use this regular expression:
let str = "";
let regex = ^[0-9]{6}$;
let match = str.match(regex);
if (match) {
console.log(match);
}
If this expression still doesn't work with your data you can use this link to automatically generate a regular expression.
You can refer to the following documents to learn how to use regular expressions in power query:
Regular expressions in Power Query – Q-stat
Using regular expressions in power bi desktop - Microsoft Fabric Community
Using Regular Expressions(RegEx) in Power BI | by Shivam Shukla | Medium
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.