0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

正規表現(PCRE)(随時更新)

0
Last updated at Posted at 2025-08-04

導入

正規表現のパターンを備忘録としてまとめます。
随時更新予定。


行末が特定の語句ではない行を検索

: 行末が「一般社員」または「クラス」、「その他」ではない行を検索する。

^(?!.*(一般社員|クラス|その他)$).+

解説

記号 意味
^ 行頭
(?! ... ) 否定の先読み。括弧内のパターンにマッチしない場合のみヒットする
.*(一般社員|クラス)$ 「任意の文字+(一般社員 または クラス)」で終わる行
.+ 1文字以上の任意の文字(空行はヒットしない)
$ 行末(先読みの中で使用)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?