MSSQL Regular expression

后端 未结 3 1667
深忆病人
深忆病人 2020-12-03 05:01

I have the following REGEX: ^[-A-Za-z0-9/.]+$

This currently checks whether the value entered into a textbox matches this. If not, it throws an error.

I need

3条回答
  •  执笔经年
    2020-12-03 05:30

    Thank you all for your help.

    This is what I have used in the end:

    SELECT *, 
      CASE WHEN [url] NOT LIKE '%[^-A-Za-z0-9/.+$]%' 
        THEN 'Valid' 
        ELSE 'No valid' 
      END [Validate]
    FROM 
      *table*
      ORDER BY [Validate]
    

提交回复
热议问题