Exp. Regular
Pessoal, tenho um novo "problema" em relação a este tópico. Resolvi abri-lo novamente.
Eu tenho uma regra, a mais tensa, que diz para selectionar todos os SELECT e pegar todo o conteúdo dentro do ENDSELECT.
Por favor,
Tenho um SELECT como um looping no ABAP, e dentro deste looping eu tenho qualquer coisa, desde espaços em branco até asterísco.
**SELECT * FROM TABELA WHERE TESTE='TESTE'.**
if t_imp[] is initial.
message e000 with 'Não existem dados para esta seleção'.
endif.
sort t_imp by repre auart kunnr vbeln posnr vdatu.
clear w_flgnew.
loop at t_imp.
at new repre.
select single * from tvkbt
where spras = 'PT'
and vkbur = t_imp-repre.
clear repre.
repre = tvkbt-bezei.
reserve 60 lines.
endat.
reserve 8 lines.
at new auart.
move 'X' to w_flgnew.
endat.
if not w_flgnew is initial.
clear w_flgnew.
select single * from tvakt
where spras eq 'PT'
and auart eq t_imp-auart.
skip.
format color 4 intensified on.
write: / 'Tipo :'.
format color 2 intensified on.
write: 10 tvakt-bezei.
endif.
at new kunnr.
move 'X' to w_flgnew.
endat.
if not w_flgnew is initial.
clear w_flgnew.
select single * from kna1
where kunnr eq t_imp-kunnr.
skip.
format color 4 intensified on.
write: / 'Cliente:'.
format color 2 intensified on.
write: 10 t_imp-kunnr, kna1-name1.
endif.
* Este é um comentário com qualquer coisa...
if t_imp-abgru is initial.
format color 2 intensified off.
write: / t_imp-vbeln,
12 '/',
14 t_imp-posnr,
25 t_imp-arktx,
69 t_imp-audat,
83 t_imp-vdatu,
97 t_imp-edatu,
114 t_imp-bmeng,
135 t_imp-rfmng,
161 t_imp-cmgst,
174 t_imp-emfor,
180 ' '.
add t_imp-bmeng to qtde_cli_s.
add t_imp-rfmng to qtde_cli_a.
add t_imp-bmeng to qtde_tip_s.
add t_imp-rfmng to qtde_tip_a.
add t_imp-bmeng to qtde_repre_s.
add t_imp-rfmng to qtde_repre_a.
add t_imp-bmeng to qtde_geral_s.
add t_imp-rfmng to qtde_geral_a.
endif.
ENDSELECT.
Eu tenho que selecionar tudo que esta dentro do SELECT ENDSELECT. Estou tentando esta exp reg.
1. [^\*]\s\b(select|SELECT)(.*?)ENDSELECT
2. [^\*]\s{1,}(SELECT|select)\s{1,}\*?[^\.]+\.
3. [^\*]\s\b(select|SELECT)[^\*]{1,}ENDSELECT
Nenhuma delas esta pegando todo o conteúdo, sempre para em algum ponto! Alguém teria alguma idéia? tks
Discussão (1)
Carregando comentários...