简体   繁体   中英

Remove lines from text file

I have a text file from which I want to exclude lines which start with the number 1 to 9. I tried to replace them with blank (empty string) using regular expressions ^\\d+(.*)$ and ^[1-9](.*)$ , but it doesn't work.

I am using AutoIt's StringRegExpReplace() command.

The anchors ^ and $ match at the beggining and end of string by default.

To make them match at the beggining and end of line , you have to set the MULTILINE (?m) modifier.

(?m)^\d.*$

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM