SOLVED

Office 365 DLP Regular Expression (RegEx)

Super Contributor

What is the O365 DLP regex for digit string below (including spaces)?

 

1234 1234 1234 1234

2 Replies
best response confirmed by Marvin Oco (Super Contributor)
Solution

There are probably dozen different ways to match this string, you can try something like this:

 

"\d{4}\s\d{4}\s\d{4}\s\d{4}"

 

If you want to avoid leading/trailing numbers:

 

"\b\d{4}\s\d{4}\s\d{4}\s\d{4}\b"

 

If you want to match the actual numbers 1..4:

 

"\b[1-4]{4}\s[1-4]{4}\s[1-4]{4}\s[1-4]{4}\b"

Thanks Vasil