Hi I need to remove some unwanted characters from a string, I'm trying to make a regex to match the required characters but I feel like I'm miles off and don't want to create false positives.
Some help would be very much appreciated.
The starting string looks like:
'SELECT \t* \nFROM \tAudit_Log a WHERE changedate > \'2016-07-21T18:51:41.900Z\''
'SELECT * FROM \tAudit_Log a WHERE changedate > '2016-07-21T18:51:41.900Z''
str = str.replace('\t', '');
str = str.replace('\n', '');
str = str.replace('\\', '');
If escape plus
a-z is the culprit, simplify it to two cases:
In the first case, the not a-z (punctuation) is written back.
In the second case, its not.
(?i) # Case insensitive \\ # '\' To be removed (?: # Cluster start ( [^\\a-z] ) # (1), Punctuation written back | # or, [\\a-z] # The rest, to be removed )? # Cluster end, and is optional for EOS