I'm converting Oracle code to SQL Server. One of my little tricks is to run regexp replaces like
TO_CHAR\((.*)\)
with
CAST(\1 AS NVARCHAR(8))
but this give me
CAST((numstring) AS NVARCHAR(8))
instead of
CAST(numstring AS NVARCHAR(8))
Apparently, the parentheses I'm using to denote the token I'm looking for become real parentheses.
Is this a bug, or am I making an error? It works fine, but there may be cases in which this bites me, so I'd like to clear it up.
Thanks! I look forward to the new RegExp forum. And news on new versions!
Parentheses clinging to my backreference
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
-
- Posts: 6
- Joined: Fri Mar 03, 2006 3:19 pm
Oh, I see
Now that you mention it, I did notice that the examples used escaped parens to bracket a search token. I just didn't internalize it.
Thanks!
Thanks!
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm