Skip to content
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

Regex: Implement named captures #904

Merged
merged 3 commits into from Jan 29, 2022

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jan 29, 2022

Regex: Implement named captures

正規表現の名前付きキャプチャ機能をラッパークラスに実装します。
グループ名またはグループ番号でマッチした文字列を取得する関数を追加します。
グループ名のみの取得APIは実際に使う箇所がないため今回は実装しません。

Add test cases for JDLIB::Regex::named_or_num()

Add provisional support for named captures to thread title search

about:configの スレタイ検索時にアドレスとスレタイを取得する正規表現に名前付きキャプチャ対応を追加します。(暫定サポート)
設定した正規表現パターンにグループ名が有れば名前付きキャプチャ、無ければグループ番号で対象を取得します。また、互換性のためグループ番号は現状を維持します。

取得対象 グループ番号 グループ名 備考
スレURL 1 url 必須
スレタイトル 2 subject 必須
レス数 3 number オプション

関連のissue: #697

正規表現の名前付きキャプチャ機能をラッパークラスに実装します。
グループ名またはグループ番号でマッチした文字列を取得する関数を追加します。
グループ名のみの取得APIは実際に使う箇所がないため今回は実装しません。
about:configの `スレタイ検索時にアドレスとスレタイを取得する正規表現`
に名前付きキャプチャ対応を追加します。(暫定サポート)
設定した正規表現パターンにグループ名が有れば名前付きキャプチャ、
無ければグループ番号で対象を取得します。また、互換性のため
グループ番号は現状を維持します。

取得対象     | グループ番号 | グループ名 | 備考
---          | ---          | ---        | ---
スレURL      | 1            | url        | 必須
スレタイトル | 2            | subject    | 必須
レス数       | 3            | number     | オプション
@ma8ma ma8ma added the feature 機能の追加と削除 label Jan 29, 2022
@ma8ma ma8ma merged commit 1d4e8d0 into JDimproved:master Jan 29, 2022
@ma8ma ma8ma deleted the regex-implement-named-capture branch January 29, 2022 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 機能の追加と削除
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant