I want to find a 2 digit variable value, however, there are two other variable values, one on each side.
The desired output can also be 00,00 as well as 0,00.
Can anyone help?
I want to find a 2 digit variable value, however, there are two other variable values, one on each side.
The desired output can also be 00,00 as well as 0,00.
Can anyone help?
Hi @Gabriel_Wisniewski ,
Is this static or dynamic and the sentences may also change and the place that you want the desired output?
Thanks,
Aditya
Sorry, I forgot to include the text.
The words are static, it starts being dynamic after the word āICMSā.
DECLARO QUE RECEBI OS VOLUMES DESTE CONHECIMENTO EM PERFEITO ESTADO PELO QUE DOU POR CUMPRIDO O PRESENTE CONTRATO DE TRANSPORTE
NOME TĆRMINO DA PRESTAĆĆO - DATA/HORA CT-E OS
NĀŗ Documento
RG INĆCIO DE PRESTAĆĆO - DATA/HORA 2.553
SĆRIE
ASSINATURA / CARIMBO 300
IDENTIFICAĆĆO DO EMITENTE
PROTEGE S/A PROT. E TRANSPORTE DACTE-OS MODAL
DE VALORES Documento Auxiliar de Conhecimento de RODOVIĆRIO
CNPJ: 43.035.146/0070-07 Transporte EletrƓnico para Outros ServiƧos
IE: 90.828.657.02
Rua Campos Salles, 39
Parque SĆ£o Paulo
85.803-560 - Cascavel - PR MODELO SĆRIE NĆMERO Data e Hora EmissĆ£o Insc. Suframa Dest.
67 300 2.553 31/03/2021 15:40:50
TIPO DO CT-E
CT-e Normal
Chave de Acesso
4121 0343 0351 4600 7007 6730 0000 0025 5315 0302 8074
TIPO DO SERVIĆO
Transporte de Valores Consulta em http://www.cte.fazenda.gov.br/portal
CĆ³digo Fiscal de OperaƧƵes e PrestaĆ§Ć£o - Nat. da OperaĆ§Ć£o Protocolo de AutorizaĆ§Ć£o de Uso
5357 - Prestacao de servico 141210045466794 - 01/04/2021 16:40:51
INĆCIO DA PRESTAĆĆO PERCURSO DO VEĆCULO TĆRMINO DA PRESTAĆĆO
PR - CEU AZUL PR - 4104808 - CASCAVEL
TOMADOR DO SERVIĆO: COOP DE CRED DE LIVRE ADM CATA MUNICĆPIO: CEU AZUL CEP: 85.840-000
ENDEREĆO: RUA CURITIBA, 1390 - - CENTRO UF: PR PAĆS: BRASIL
CPF / CNPJ: 78.414.067/0007-55 Insc. Estadual: Fone:
INFORMAĆĆES DA PRESTAĆĆO DO SERVIĆO
QUANTIDADE DESCRIĆĆO DO SERVIĆO PRESTADO
0 Transporte de Valores
COMPONENTES DO VALOR DA PRESTAĆĆO DE SERVIĆO
NOME VALOR NOME VALOR NOME VALOR NOME VALOR VALOR TOTAL DO SERVIĆO
2.754,31
VALOR A RECEBER
2.754,31
INFORMAĆĆES RELATIVAS AO IMPOSTO
CLASSIFICAĆĆO TRIBUTĆRIA DO SERVIĆO BASE DE CĆLCULO ALĆQUOTA ICMS VALOR ICMS % RED.BC.CALC.
00 - TributaĆ§Ć£o normal do ICMS 2.754,31 12,00 330,52
OBSERVAĆĆES
Servicos de transporte de valores Vencimento da Fatura 12/04/2021; SUJEITO A RETENCAO DE 1,0% IRRF,ARTIGO 55, LEI 7713
DE 22/12/1988 - R$ 27,54; RETENCAO PARA SEGURIDADE SOCIAL - INSS: 302,97 ; PIS: 17,90 ; COFINS: 82,63 ; CSLL: 27,54 ; Sujeito
a retencao de 4,65% de PIS/COFINS/CSLL conforme Lei 10.833/2003 art. 30 e Lei 13.137/2015 art. 24
SEGURO DA VIAGEM
RESPONSĆVEL NOME DA SEGURADORA NĆMERO DA APĆLICE
INFORMAĆĆES ESPECĆFICAS DO MODAL RODOVIĆRIO
TERMO DE AUTORIZAĆĆO DE FRETAMENTO NĆMERO DE REGISTRO ESTADUAL PLACA DO VEĆCULO RENAVAM DO VEĆCULO CPF / CNPJ:
USO EXCLUSIVO DO EMISSOR DO CT-E RESERVADO AO FISCO
CT-e OS gerada com tecnologia NF-e SecurityĀ® da Benefix - http://www.webenefix.com.br
Include it now.
I edited it.
Hi:
Try this:
output = System.Text.RegularExpressions.Regex.Match(your_String,"(?<=TributaĆ§Ć£o.+ICMS\s.+\s)\d{1,2}(,|.)\d{1,2}(?=\s\d+(,|.)\d+$)").Value
Preview link: regex101: build, test, and debug regex
Or this:
output = System.Text.RegularExpressions.Regex.Match(your_String,"(?<=ICMS\s+[\d.,]+\s+)[\d.,]+(?=\s[\d,.])").Value
Preview link: regex101: build, test, and debug regex
@Gabriel_Wisniewski - As an Alternateā¦
(?<=ICMS\s+\S+\s+)[\d.,]+
Note: I have also included . in my pattern and this can grab any valuesā¦you can test itā¦
It works, thank you both.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.