Regular Expression to match specific string followed by number?

前端 未结 3 478
孤城傲影
孤城傲影 2020-12-31 01:15

What regular expression can I use to find this?

&v=15151651616

Where &v= is a static string and the number part may va

3条回答
  •  春和景丽
    2020-12-31 01:46

    I tried the other solutions but those were not working for me but the following worked.

    NAME(column):
        dbbdb
        abcdef=1244
        abc =123sfdafs
        abc= 1223 adsfa
        abc = 1323def
        abcasdafs =adfd 1323def
    

    To find 'bc' followed by a number, Code:
    . -> match any character
    ? -> optional (show even if there are no characters)
    + -> in addition to the search keyword

    where regexp_like (NAME, 'bc.?+[0-9]');
    Output:
    abcdef=1244
    abc =123sfdafs
    abc= 1223 adsfa
    abc = 1323def
    abcasdafs =adfd 1323def
    

    To find 'bc' followed by '=' and a number, no matter the spaces, Code:

    where regexp_like (NAME, 'bc ?+[=] ?+[0-9]');
    Output:
    abc =123sfdafs
    abc= 1223 adsfa
    abc = 1323def
    

提交回复
热议问题