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.
Rの文字列にこの形式があるかどうかを確認したい
NNNN__NNN
つまり、4 つの数字 (N は任意の数字 [0,9] を表します)、2 つのアンダースコア、3 つの数字です。
何か助けはありますか?
どうもありがとう
grepl("\\d{4}__\\d{3}","1234__12reg3")
False を返します
grepl("\\d{4}__\\d{3}","1234__123")
True を返します
\d は正規表現の数字です。?grepl を確認する必要があります