Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
.NET 7.0 (C#)

@"
[^0-9a-zA-Z|\\/ !#$%^&*()[{}\]:<>?_\\]+
"
gm

Description

see owasp recommendation for things to remove from a csv export.

this expression matches on following characters [. , ; + = - @ ' "] also carriage return

make sure to clear strings for whitespace and choose your preferred methods for additional security from the examples in the owasp documentation

https://owasp.org/www-community/attacks/CSV_Injection

Submitted by anonymous - 2 years ago