Ticket #47537

strmatch

오픈 날짜: 2023-03-08 02:08 마지막 업데이트: 2023-05-08 00:09

Reporter:
소유자:
(None)
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Invalid
File:
None
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
댓글 올리기

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
  • Status Update from Open to Closed
  • Resolution Update from None to Invalid

Attachment File List

No attachments

Edit

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