hi,
from this link https://docs.microsoft.com/en-us/sql/ssms/scripting/search-text-with-regular-expressions?view=sql-server-ver16
i found :b matches either space or tab charcters , pls tell me how to use. i used but it was not working.
September 15, 2022 at 8:10 am
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
September 15, 2022 at 2:30 pm
hi,
from this link https://docs.microsoft.com/en-us/sql/ssms/scripting/search-text-with-regular-expressions?view=sql-server-ver16
i found :b matches either space or tab charcters , pls tell me how to use. i used but it was not working.
We have no idea what "I used" means nor what you're trying to actually do. Please post a code example and explain what you expect it to do.
--Jeff Moden
Change is inevitable... Change for the better is not.
The documentation you've link is for the Find (and Replace) tool, is that what you are using? I admit, :b
does not work for me for tabs or spaces either, but [ \t]
does.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
September 15, 2022 at 6:54 pm
The key here is to realize the misnomer. What you find in SSMS is NOT a full version of RegEx. I'm not sure it even qualifies as a valid subset.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 15, 2022 at 8:11 pm
The problem here is that the regex search and replace for SSMS was changed to use Visual Studio regex search and replace https://docs.microsoft.com/en-us/visualstudio/ide/using-regular-expressions-in-visual-studio?view=vs-2022 but the documentation was never updated to reflect that change.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 15, 2022 at 8:16 pm
The key here is to realize the misnomer. What you find in SSMS is NOT a full version of RegEx. I'm not sure it even qualifies as a valid subset.
Regex is the name of a broad class of formal languages. There is no one single regex language, so trying to define one regex language in terms of another is just as pointless as trying to define English in terms of Malayalam.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 16, 2022 at 4:31 pm
Jeff Moden wrote:The key here is to realize the misnomer. What you find in SSMS is NOT a full version of RegEx. I'm not sure it even qualifies as a valid subset.
Regex is the name of a broad class of formal languages. There is no one single regex language, so trying to define one regex language in terms of another is just as pointless as trying to define English in terms of Malayalam.
Drew
You've just made my point, Drew. 😀 Even if you go to the MS documentation about what they use, SSMS uses only a subset of even that. Just because someone says "RegEx", it doesn't mean anything about what a particular use contains.
It's like saying that one knows "SQL"... which "flavor". 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
October 4, 2022 at 11:06 am
like [ \t] is used for spaces and tabs, is there anything for finding carriage return in TSQL
ex
where Result =
'Uwon'
October 4, 2022 at 11:33 am
\r is carriage return. \n is line feed. So typically in Windows you're searching for \r\n
October 4, 2022 at 3:12 pm
like [ \t] is used for spaces and tabs, is there anything for finding carriage return in TSQL
ex
where Result =
'Uwon'
For T-SQL, Yes... search for CHAR(10) for the newline character and CHAR(13) for carriage return. It would be good to get to know more about such "control characters" using the following links...
https://learn.microsoft.com/en-us/sql/t-sql/functions/char-transact-sql
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply