惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Last Watchdog
The Last Watchdog
B
Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
博客园_首页
N
News and Events Feed by Topic
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Security Archives - TechRepublic
Security Archives - TechRepublic
Y
Y Combinator Blog
Vercel News
Vercel News
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
H
Hacker News: Front Page
云风的 BLOG
云风的 BLOG
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Recorded Future
Recorded Future
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
Microsoft Azure Blog
Microsoft Azure Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
S
Schneier on Security
Project Zero
Project Zero
MyScale Blog
MyScale Blog
博客园 - 聂微东
F
Fortinet All Blogs
AWS News Blog
AWS News Blog
W
WeLiveSecurity
L
LangChain Blog
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
Scott Helme
Scott Helme
S
Secure Thoughts
A
Arctic Wolf
The Register - Security
The Register - Security
C
Check Point Blog
Security Latest
Security Latest
O
OpenAI News
S
Securelist
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events

博客园 - 嚣张的沉默

读写txt文档 限制TextBox输入字数 计算TextBox输入的字数 DataSet导入到Excel 年月日联动的JS代码 用户控件的传值方法 Repeater模板列 asp.net的几个小技巧 百叶窗效果 建站安全 倒计时代码 解决SQL2000安装服务器挂起 删除.NET的最近项目 屏幕右下角弹出广告 DataSet写入、导出XML 上传图片重命名并创建文件夹 自动跳转页面带参数 微软出的AJAX控件的安装(转载) 第一次开博
我常用的正则与SQL语句
嚣张的沉默 · 2008-01-25 · via 博客园 - 嚣张的沉默

//判断是否为字母与数字
^[A-Za-z0-9]+$

//判断移动电话或固定电话(我是大连的,所以区号是0411)
^(?:1[35]\d{9}|0411\d{8})$

//判断年龄
^(1[0-2]\d|\d{1,2})$

//字母数字汉字
^[a-zA-Z0-9\u4e00-\u9fa5]+$

//判断是文件类型

^.+\.(jpe?g|JP?G|Jp?g|GIF|Gif|gif)$

===================================================================

还有一些SQL语句
//查询本周情况
select * from cardInfo
where
datepart(wk,字段名)=datepart(wk,getdate())
and
datepart(yy,字段名)=datepart(yy,getdate())

//随机抽取4个
select top 4 * from tablename order by newid()

//不全显示电话号码
select left(ltrim(字段名),3)+'****'+right(rtrim(字段名),4) from 表名
Select Stuff(字段名, 4, 4, '****') As num From 表名

//数据为1或0,显示出来为是或否
select (case 字段名 when 1 then '是' else '否' end) as isTrade from client

//把字段中的回车替换成空格

select audName,audSex,audAge,audTel,replace(audcontent,char(13)+char(10),''),audEpname as 游戏名称,audTime from audited

//循环插入数据

declare @a bigint
set @a=2008080841100001
while @a<=2008080841199999
begin
insert into card(cardNum)
select @a
set @a=@a+1
end


declare @k bigint
declare @n bigint
set @k=2008080841100001
select @n=max(cardnum) from card
while(@k<2008080841199999)
begin
INSERT INTO [card]
           ([cardnum])
     VALUES
           (@k)
set @k=@k+1
end

循环更新某字段

declare @t table(aaa int,  eee int,  ccc varchar(2),  ddd  int)
insert @t select
1 ,   2    ,'a',    100  union select
2 ,   2    ,'a',    null union select
3 ,   1    ,'c',    null union select
4 ,   2    ,'a',    null union select
5 ,   3    ,'a',    null union select
6 ,   2    ,'b',    null union select
7 ,   2    ,'a',    null union select
8  ,  2    ,'a',    null union select
9  ,  2    ,'a',    null 


declare @i int
set @I = -1

update @t 
set ddd = @i,@i =isnull(ddd,0+ @i +1
where eee = 2 and ccc = 'a'
select * from @t