Today in the use of regular expressions, to match two characters in the middle of the content, temporarily did not write out, and later found on the Internet, recorded.
Match two strings between A and b the string contains a and B:
Expression: a.*? B ("." Represents any character, ". "represents a match of 0 or more)
Example: Abaidu.comb
Result: Awww.apizl.comB
Match two strings between A and b the string contains a but does not contain B:
Expression: a.*? =B)
Example: Awww.apizl.comB
Result: Awww.apizl.com
Matches the string between two strings A and B and does not contain a and B:
Expression: (? <=a). *? =B)
This kind of writing does not understand, I guess is if not include the preceding matching character (? <= to match the start character), does not contain the following to match the character writing (. = end character to match)
Example: Awww.baidu.comB
Result: www.baidu.com