I have a problem with regular expression. (? <= NSC). + [0-9]
Although I entered [0-9] he is returning part of the sentence after NSC
text
Val aproximado dos tributos: R$ 26,73 ( Fonte IBPT ) COMPL END:SALA 267 - DISTRITO SOUSAS CLARI JULIANE PIETSCH ORC 52783 ORDEM DE COMPRA: 0209023029 - NSC 16092 *** UNIDADEUNIDADE UNIDADE *** DADOS P/ DEPOSITO: B Documento emitido por ME ou EPP optante pelo simples nacional, nao gera direito a credito fiscal ICMS, ISS e IPI conf. lei complementar 123/2006
expression
(?<=NSC).+[0-9]
Returne
16092 *** UNIDADEUNIDADE UNIDADE *** DADOS P/ DEPOSITO: B Documento emitido por ME ou EPP optante pelo simples nacional, nao gera direito a credito fiscal ICMS, ISS e IPI conf. lei complementar 123/2006
and i used this expression in studio as well along the writeline activity System.Text.RegularExpressions.Regex.Match(str.ToString,“(?<=NSC).[0-9]+”).ToString
where i stored this text in a txt file and used like this
yeah, really weird. I celebrated ahead of time, it didn’t work lol … I don’t know where else to go.
I’ll post some examples of texts that I need to remove the NSC
VENDEDOR DANILO - NRO. PED INTERNO 1581932 - RETIRADO POR FRANCIS REENDERECO COBRANCA RUA A******1 VILLE SAINTE HELE CAMPINAS SP 1 VALOR TRIBUTOS FEDERAL R ********VALOR TRIBUTOS ESTADUAL R *******PEDIDO NCC 0202028002 NSC 166415
Val aproximado dos tributos: R$ 26,73 ( Fonte IBPT ) COMPL END:****** - DISTRITO SOUSAS CCH ORC 52783 ORDEM DE COMPRA: 0209023029 - NSC 16092 *** UNIDADE AIRON MONTAIN TATUQUARA *** DADOS P/ DEPOSITO: BANCO*********Documento emitido por ME ou EPP optante pelo simples nacional, nao gera direito a credito fiscal ICMS, ISS e IPI conf. lei complementar 123/2006
NCC 0209028013|NSC 165028|Voce pagou aproximadamente: |R$ 27,22 de tributos federais|R$ 52,20 de tributos estaduais|Fonte: IBPT/empresometro.com.br 0C3829
PEDIDO AUTORIZADO POR Caroline Buchling NCC 0209028014 NSC 166256 Forma(s) de pagamento: Boleto Bancario: 437.34
You can use this in advanced expression: (NSC \s*(\d+)\s*\*\*\*)
But you will need to access the groups to get just the number:
matches.FirstOrDefault().Groups(2)