SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO -- 注释 GSP_L_LabCheck Create PROCEDURE [GSP_L_LabCheckBill] ( @szFlag [varchar] (20), @BillnumberID [numeric] (18, 0), @Number [varchar] (20), @ReportNo [varchar] (30), @ReportDate [varchar] (20), @CheckMan [varchar] (20), @CheckEID [varchar] (25) ) AS if lower(@szFlag)=""new"" begin select @BillNumberId = isnull(max(BillNumberId),0) from GSP_L_LabCheck select @BillNumberId = @BillNumberId + 1 end insert into GSP_L_LabCheck ( [BillNumberID], [Number], [ReportNo], [ReportDate], [CheckMan], [CheckEID] ) values ( @BillNumberId, @Number, @ReportNo, @ReportDate, @CheckMan, @CheckEID ) if @@rowCount=0 return -1 ---注释 else return @BillNumberId GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO --注释 存储过程2代码 SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO --注释 --注释 存储过程三代码 SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO ———————————— 问题1———————————— –注释 —————————问题2————————— 请教应该如何写表达式匹配? |
|
--[^\r\n]* 不知道是不是你要的第一个 |
|
\bCreate\s+PROCEDURE\s+([^\s\n\r]+)(?=[\s\n\r]) 第二个$1存储过程 |
|
总共有1000+个存储过程,我想要所有的代码 |
|
除非你把例子写详细,而不是–,至少要举2个存储例子,否则看不懂……
|
|
首先谢谢你的耐心解答,下面是我找到的几个内容较短的代码 SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO CREATE PROCEDURE GP_QuanlityCheckPj (@flag varChar(10)="""") As select cast("""" as varchar(100)) PJTypeNumStr,cast("""" as varchar(100)) PJTypeNameStr,* from QuanlityCheckPj where deleted=0 GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO CREATE PROC GP_QuanlityCheckPjQuery ( @pjtype ctint ) As select * from QuanlityCheckPj where deleted=0 and pjType = @pjtype GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO 另外我测试了你的 |
|
本来是想要得到的代码加下划线的结果变成了<span style=”……;”></span>存储过程中的注释我想得到;如你第一个表达式–[^\r\n]*只能获得两个以“-”开头的注释 |
|
存储过程名$1可以将[]替换掉
var group1Value; Regex.Replace(group1Value,"[\[\]]",string.Empty) \bCreate\s+PROCEDURE\s+\[*([^\s\n\r]+)\]*\b没多大问题,只要你的存储过程是正确的 |
|
看你意思你是要取两个
SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO 之间的SQL? |
|
是的, |
|
我也看不懂啊 |
|
40分 |
SET\s+ANSI_NULLS\s+ON\s+GO([\s\S]*?)(?=SET\s+QUOTED_IDENTIFIER\s+OFF) $1为存储过程 |
兄台,十分感谢你。分很少全给你了,你耐心指导这种精神是无价,让人钦佩 |