Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 338 Bytes

regex.md

File metadata and controls

15 lines (11 loc) · 338 Bytes

Regex

Extract alphanumeric characters from a string

Regex regexFileName = new Regex("[^a-zA-Z0-9 -]");
fileName = regexFileName.Replace(fileName, "");

Extract the table name from a query

Regex regexTable = new Regex("(?<=\\bFROM\\s)(\\w+)");
Var tableName = regexTable.Match(Query, 0, Query.Length)