How to use Regular Expression in sql server?

前端 未结 2 941
抹茶落季
抹茶落季 2020-12-10 07:03

Is it possible to make efficient queries that use regular expression feature set.I got data in my table which is not in correct format,EX:-In Title colum: Cable 180â

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 07:45

    You need to make use of the following. Usually requires combinations of the three:

    1. patindex
    2. charindex
    3. substring

    In response to your comment above, patindex should not 0 where the case is found. patindex finds the start location of the pattern specified, so if patindex finds the case, it should return an integer > 0.

    EDIT:

    Also, len(string) and reverse(string) come in handy on specific occasions.

提交回复
热议问题