Forum Discussion
Timble
Mar 13, 2025Copper Contributor
Multiple spaces in a regex
Hello folks. I was trying to write a regex that would detect Secret S E C R E T S e c r e t se C re T ie, 'secret', case-insensitive and possibly with spaces between the lett...
- Mar 26, 2025
Thanks for reaching out. Try this pattern (?i)\bs\s*e\s*c\s*r\s*e\s*t\b to see if it fits your scenario.
milgo
Microsoft
Mar 26, 2025Thanks for reaching out. Try this pattern (?i)\bs\s*e\s*c\s*r\s*e\s*t\b to see if it fits your scenario.
- TimbleApr 10, 2025Copper Contributor
Thank you, Milgo. That works in a SIT. I hadn't tried my original regexes there, and haven't tried your solution in a rule, but I'm happy that there is a solution. I'll probably continue testing, and certainly think about the risks of having all whitespace and not just spaces in the acceptable optional separators list.