Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列検出のために PCRE で正規表現を作成しようとしています。検出したい文字列の種類は、abcdef001、zxyabc003 です。最初の 6 文字の単語は a ~ zA ~ Z で、最後の 2 ~ 3 文字は数字の 0 ~ 9 です。この文字列は、テキスト全体のどこにでもある可能性があります。
例 - 「server1 からのユーザー アクティビティ、ユーザー ID abcdef009、時間 10:20am」。
abcdef009
どうすればいいですか?
正規表現パターンを使用
/[a-z]{6}\d{2,3}/i