匹配来自文件的第一个文本块,在2个string之间
我试图仅匹配2个string之间的第一个文本块:“menuentry”和“}”,如下所示: input文件: (some irrelevant text) menuentry 'My Customized Linux, with Linux 3.10.0-229.14.1.el7.x86_64' –class centos –class gnu-linux –class gnu –class os –unrestricted $menuentry_id_option 'gnulinux-3.10.0-229.14.1.el7.x86_64-advanced-/dev/mapper/sysvg-lv_root' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod xfs set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search –no-floppy –fs-uuid –set=root –hint-bios=hd0,msdos1 –hint-efi=hd0,msdos1 –hint-baremetal=ahci0,msdos1 –hint='hd0,msdos1' 2e420275-8578-449d-9217-ce6d9ae35f70 else search –no-floppy –fs-uuid […]