-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Posix classes are not strict enough [:upper:]
#253
Comments
Aren't you going to do a little research before you make three posts?
The only thing that could be debatable would be which case would be an error when an incomplete POSIX Bracket appears. |
Lines 214 to 215 in 08d3611
If you want to make it clear that it is not Posix class, you can use The following behavior may be a trap for anyone who does not intend to use the Posix class:
Escape is effective to avoid the above behavior.
These will have the same result. match at 0 Remarks: Perl 5
|
There was a problem with the processing after "[:", so a corrected version was added as issue_253 branch. |
translation by google translate (August 24, 2023)Background on this issue
Proposal 1I think that the misspelling of the Posix class name should be treated as an error. If the user is unaware of their spelling mistake, it will be interpreted character by character, By the way, spelling mistakes in \p{property-name} are errors. If I use sample/callout.c and try the below code with misspelling inside I get an error like: A misspelling within RedCMD did not clearly write "what is the problem and how to fix it". RedCMD didn't think "Incomplete Posix bracket is an error" was the problem. (I'm reading through Google Translate, so I'm sorry if I'm wrong) Proposal 2Perl plans to introduce While fixing issue253, If Perl5:
However, I think that it will be a long time before these are implemented in Perl. Investigation result of boundary of Posix bracket using Perl 5.35.11I don't know if it will be a reference for oniguruma production, but I will put it on. (Click to view) The boundary between Posix bracket and notMay 13, 2022 (English translation : August 26, 2023 ) I used the Perl 5.35.11 Development release for this research. Recognized as a normal character class
Recognized as Posix bracket
regular expressions on Issue 253Unlike oniguruma, Perl does not allow normal character class nesting. Recognized as a normal character class
Recognized as Posix bracket
end.
Sorry for #234, I apologize again. Original text (written in Japanese)● この問題にある背景
● 提案 1 Posix class 名のスペルミスはエラーにしたほうが良いと思う。 ユーザーが自分のスペルミスに気付かなかった場合、1文字ずつに分解されて解釈され、 ちなみに、 \p{property-name} のほうではスペルミスはエラーになる。 sample/callout.c を使って \p{ } 内にスペルミスがある以下のコードを試すと.. 以下のようなエラーが出る。 \p{ } 内でのスペルミスがエラーになることにより、 Posix bracket 内でのスペルミスもエラーになると issue 253主である RedCMD氏の書き込みは "何が問題でどう直すべきか" をはっきりと RedCMD氏 は "不完全な Posix bracket がエラーになる" ことを問題視していたというよりは ( 自分はGoogle翻訳を通して読んでいるので間違っていたらごめんなさい ) ● 提案 2 Perl では将来、 [= ~ =] や [. ~ .] の導入が予定されており、将来 oniguruma もこれを issue 253 の修正のついでに [= ~ =] や [. ~ .] を予約語としてキープしておけば Perl5: [= =] and [. .]
ただし Perl にこれらが実装されるのは相当先の話だと思うので ● Perl 5.35.11 を使ったPosix bracket の境目の調査結果 oniguruma 制作の参考になるかどうか分かりませんが一応貼っておきます。 [DOC] oniguruma_253.doc ※ これは oniguruma の動作を Perl の挙動とまったく同じにして欲しいという主旨ではありません。 #234 ではすみませんでした、重ねてお詫びします。 |
It would be nice to make spelling errors an error. For my part, I would like to misspell only 2), and 1) is not a POSIX bracket. It would be good to reserve [= =] and [. .]. |
translation by google translate (August 23, 2023)
(2) is OK.
If you don't plan to implement these, I don't think you need a reservation, but
This is OK. I will leave it to you to decide whether to make a reservation or not. ----------------------- Added on June 2, 2022 ----------------------------- Original text (written in Japanese)
(2) で OK です。
これらを実装する予定が無いのなら私は予約が必要だとは思いませんが、
これで OK です。 予約するかどうかの判断は Kosako氏におまかせ致します。 |
translation by google translate (August 23, 2023)Negative form has the same result as positive form.
------------------ Added on June 16, 2022 ------------------ This bug has been fixed. Thank you for fixing. Original text (written in Japanese)Negative form has the same result as positive form. 否定形が肯定形と同じ結果になってしまいます。
|
Assume the current master head is accepted. |
Multiple posix classes can be opened at once with many left brackets
[:
and then can all be closed on the same right bracket:]
The below regex runs and will match all upper case letters aswell as
a
,b
,c
and:
.Note how there are many opening brackets, but only 2 closing.
And if posix a value is inputted in the middle, the engine breaks:
Engine also breaks if any one of the
:
gets removedInitial report from: microsoft/vscode-textmate#165
The text was updated successfully, but these errors were encountered: