First, start by figuring out what the regular expression does.
Let's break this one down:
[\r\n]$
The brackets []
give you a character class and says "match one of these characters." Thus [\r\n]
says match \r
(carriage return) or \n
(line break). The $
is an anchor and says "match at the end of the string." Thus, the regular expression says "match a carriage return or line break at the end of the string."
Now, can you translate that into SQL? For this you need something like
SELECT * FROM TABLE
WHERE
SOMECOLUMN LIKE '%'||CHR(13)||CHR(10) OR
SOMECOLUMN LIKE '%'||CHR(13)
(Sorry, my Oracle is weak but this is a close first approximation.)
If not, can you get the data out of your table (SELECT * FROM TABLE
) and run this regex locally in .NET? Twenty-thousand rows is not that much to just pull the whole thing into memory and run it locally.