Regular Expressions match rows other than XXX

Source: Internet
Author: User

1111111111111
There is content on the front, but there is content on the back of 123.123.123.10.
3333333333333
4444444444444

How to match "non:. + 123.123.123.10. +"
Line

The matching result is,
1111111111111

3333333333333
4444444444444

Conclusion:

^ (?!. * 123.123.123.10). * $
Or C:

Textbox2.text = RegEx. Replace (textbox1.text, @ "\ n. * 123 \. 123 \. 123 \. 10. * \ n", "\ n \ r \ n ");
String result = RegEx. Replace (STR, @ "^ .*? 123 \. 123 \. 123 \. 10. * $ "," ", regexoptions. multiline );
RegEx Reg = new RegEx (@"(? <= ^ | \ R \ n )(?! 123 \. 123 \. 123 \. 10). + ");

Summary:

The expression that matches non-"non-content" rows should be written as: ^ (?!. * Non-content). * $

===============================================< br> In addition, another example:
2008-07-14 15:44:40 w3svc491 60.27.236.4 get/item/How-To-Connection-My-Computer-Flow-IP-yongfa365.html-80-74.6.22.106 Mozilla/5.0 + (compatible; + Yahoo! + Slurp; + http://help.yahoo.com/help/us/ysearch/slurp) 200 0
2008-07-14 15:44:51 w3svc491 60.27.236.4 get/item/Clear.bat-System-Windows-98-XP-2003-yongfa365.html-80-124.73.140.102 Mozilla/4.0 + (compatible; + MSIE + 6.0; + windows + nt + 5.0) 200 0 64
2008-07-14 15:44:51 w3svc491 60.27.236.4 get/item/Clear.bat-System-Windows-98-XP-2003-yongfa365.html-80-124.73.140.102 Mozilla/4.0 + (compatible; + MSIE + 6.0; + windows + nt + 5.0) 206 0 64
2008-07-14 15:47:11 w3svc491 60.27.236.4 get/articles. XML-80-65.214.44.28 Bloglines/3.1 + (http://www.bloglines.com; + 1 + subscriber) 200 0 64
2008-07-14 15:47:47 w3svc491 60.27.236.4 get/item/SQL-Server-Store-More-Than-8000-WRITETEXT-UPDATETEXT-yongfa365.html-80-59.125.118.13 trend + micro + Web + protection + Add-on + 1.10.1144 200 0 0

Find the rows in the preceding row, not ending with "200 0 64", and then delete

^ (?!. * 200 0 64). * $

I have been doing this test:
^ (?!. * 200 0 64) $
No. * I don't think there is any content in the back, so I don't want to write it. * if I don't want to write it, I just need to write it. Which of the following experts can give me some advice.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.