Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
154 views
in Technique[技术] by (71.8m points)

What Regex would capture everything from ' mark to the end of a line?

I have a text file that denotes remarks with a single '.

Some lines have two quotes but I need to get everything from the first instance of a ' and the line feed.

I AL01                  ' A-LINE                            '091398 GDK 33394178    
         402922 0831850 '                                   '091398 GDK 33394179    
I AL02                  ' A-LINE                            '091398 GDK 33394180    
         400722 0833118 '                                   '091398 GDK 33394181    
I A10A                  ' A-LINE 102                       '  53198 DJ  33394182    
         395335 0832203 '                                  '  53198 DJ  33394183    
I A10B                  ' A-LINE 102                       '  53198 DJ  3339418
question from:https://stackoverflow.com/questions/65829515/end-of-line-or-end-of-string-with-regex

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
'.*

I believe you need the option, Multiline.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...