正規表現の勉強まとめ
サンプル1
元のテキスト
QSE>~DEVICE,0x03c5081f,0,21,8 QSE>~DEVICE,TESTQS,70,3 QSE>~DEVICE,Roller Shade 2,0,14,100.00
case 1
(?:~DEVICE,TESTQS,70,)\d+\n
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage.png)
case 2
\d+\n
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage-1.png)
サンプル2
正規表現で文字列からほしい部分を抽出する – まずは蝋の翼から。
元のテキスト
model_hoge:fuga_piyo:fuga
case 1
_([^_])+:
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage-2.png)
case 2
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage-3.png)
case 3
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage-4.png)
case 4
(?<=expression) 前方一致指定(Ver1.70対応版)
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage-5.png)
case 5
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage-6.png)
case 6
![UntitledImage.png UntitledImage](https://digital-light.jp/wp-content/uploads/2023/01/UntitledImage-7.png)
case 7
正規表現:メタ文字(特殊文字)の一覧 | WWWクリエイターズ
![](https://digital-light.jp/wp-content/uploads/2023/01/3e8bf98aec3f6da3a11514a8f03f99a9.png)