Tíquete #47537

strmatch

: 2023-03-08 02:08 Última Atualização: 2023-05-08 00:09

Relator:
Dono:
(Nenhum)
Tipo:
Estado:
Fechado
Componente:
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Invalid
Arquivo:
Nenhum
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

Hello.

I would like to use strmatch to find '.' character in a string. strmatch '0 1.:23.:45.:67.:89.:a b' #46 But result will be always: 1

I tried '.' and #46 ASCII version too. With other characters it works and it tells the first position of the string what it founds.

I think it is a bug.

Best regards,

Tibor

Ticket History (3/3 Histories)

2023-03-08 02:08 Updated by: vatiacg
  • New Ticket "strmatch" created
2023-03-08 07:27 Updated by: nmaya
Comentário

Hi,

In Regular Expression, '.' matches any character.

cf. https://github.com/kkos/oniguruma/commit/9abbf54a3a12e3c637766813a6d58e71bc5a7cc5#diff-8a4fca15b4e397422096d6e0b219c3a97bf2f1efcb4485e12346c31cc0b33d8cL48

You have to escape it to match '.'.

strmatch '0 1.:23.:45.:67.:89.:a b' '.'
messagebox result 'not escape'

strmatch '0 1.:23.:45.:67.:89.:a b' '\.'
messagebox result 'escape'
2023-05-08 00:09 Updated by: nmaya
  • Estado Update from Aberto to Fechado
  • Resolução Update from Nenhum to Invalid

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login