zoukankan      html  css  js  c++  java
  • 常用正则表达式总结(以后加了再补充)

    不包含某些字符:^((?!(字符1|字符2)).)*$
    包含a但不包含b:^(?=.*(a))(?!.*(b)).+$ 或(?=.*(a))^(?!.*(b)).+$
    同时包含a和b:(?=.*a)(?=.*b)^.*$ 或 ^(?=.*a)(?=.*b).*$
    数字范围(如:1-36):^d$|^[1-2]d$|^3[0-6]$
    包含1且包含2或3:(?=.*(2|3|.))^.*1.*$

    分页sql:参数:@pageIndex(当前页数)  @pageSize(每页条数)

    方法一:(对于有id的)

               select top @pageSize * from T where id between @pageSize*(@pageIndex-1)+1 and @pageSize*@pageIndex

           或 select top @pageSize * from T where id not in (select top @pageSize*(@pageIndex-1) id from T)

    方法二:select * from

    (select *, row_number() over(order by id) Num,* from T) a 

    where Num between @pageSize*(@pageIndex-1)+1 and @pageSize*@pageIndex

  • 相关阅读:
    2016去哪儿编程题:乘坐公交
    lintcode:交错正负数
    lintcode:Ugly Number I
    KMP算法
    适配器模式
    迭代器模式
    命令模式
    外观模式
    工厂方法模式
    代理模式
  • 原文地址:https://www.cnblogs.com/lpynb/p/6037967.html
Copyright © 2011-2022 走看看