SQL server regular expression. Fetching keyword from a sentence using regular express

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • santoshpras1
    New Member
    • May 2014
    • 1

    SQL server regular expression. Fetching keyword from a sentence using regular express

    I am using the below query to search some text in a sentence
    Code:
    declare @a nvarchar(100)
    set @a=N'%[ /\\@\&\*()\-\+\|\>?,\":;/、・¥—&*(-》>?,;“”〉\- ][public]'
    
    declare @b nvarchar(50)
    
    set @b='public property'
    
    select @b where @b like '%' +@a+'%'
    the problem is that I just want to fetch special character or the exact keyword.
    example: I want public or &public not republic

    could u please help
    Last edited by Rabbit; May 23 '14, 12:17 AM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    SQL Server doesn't have support regular expressions with the LIKE operator. For more info on SQL Server's version of pattern matching using the LIKE operator, here is a link to their documentation: http://technet.microsoft.com/en-us/l.../ms179859.aspx.

    Comment

    • prigupta2
      New Member
      • Oct 2008
      • 33

      #3
      Sir please explain in detail so we try to give answer

      Comment

      Working...