pcregrep multiline SQL match

安稳与你 提交于 2021-01-28 05:57:19

问题


I'm trying to match following multiline SQL code with pcregrep:

   create table work.W4XLP0D as
      select distinct
         Name,
         ('ABCD') as xxx length = 4
   from &SYSLAST
      where Name='Alfred'
   ;

I wanna match distinct and ('ABCD') but it's possible that there are more than one Attributes in select statment... If tried the following:

[y1e1819@sasbidientw01 ~]$ pcregrep -M '(\n).*\(\".*\"\) as' *.sas
double_distinct.sas:         Name,
         ("ABCD") as xxx length = 4

But I'm not able how to say that there can be multiple line breaks

来源:https://stackoverflow.com/questions/52430747/pcregrep-multiline-sql-match

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!