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.