1. Test text
<A href = 'HTTP: // search/. aspx '> Home </a> <a href ='/AAB/BB '> Hello </a> <a href = 'HTTP: // www.sohu.com '> Sohu </a> <p> sdfsf </P> <a href = "/AAB/BB"> Hello </a> <div> Hello World </div> <a href = "Aaa/BB"> </a>
2. Add domain names for intra-Site Links
using system; using system. collections. generic; using system. LINQ; using system. text; using system. text. regularexpressions; using system. io; namespace consoleapplication1 {class program {static void main (string [] ARGs) {string S = file. readalltext (@ "C: \ a.txt"); // Add a domain name to all non-HTTP links. no/string d = RegEx before the link. replace (S, @ "
A. does not contain HTTP ,(?! HTTP.
B. Non-Greedy match?> Indicates that the first match exists.
C. $1 indicates the previous Group 1.
D. Double quotation marks \ "" in the Mode \""
E. Double quotation marks are represented by two "" characters in the @ escape string.