Recently, many posts have asked you how to extract the content from the database and use a new line. This requires a regular expression. In short, regular expressions are a powerful tool for pattern matching and replacement. We can find regular expressions in many programming languages, such as vi Editor, Perl or PHP scripting language, and awk or sed shell programs. In addition, client scripting languages such as JavaScript also provide support for regular expressions. It can be seen that regular expressions have gone beyond the limits of a language or system and become widely accepted concepts and functions.
Regular Expressions allow users to construct matching modes by using a series of special characters, and then compare the matching modes with target objects such as data files, program input, and form input on the web page, execute the corresponding program based on whether the comparison object contains the matching mode.
I mainly describe the line feed display of multiline text:
Sub show (Str) 'multi-line text display function
Str = replace (str, chr (13), "<br>" & chr (13) + chr (10 ))
Str = replace (str, chr (32 ),"")
Response. write str
End sub
Here we use the regular expression object method: Replace ()
Method.
The Replace method syntax is as follows:
Description
Replace the text found in the regular expression search.
Syntax
Object. Replace (string1, string2)
The syntax of the Replace method includes the following parts:
Partial description
Required. It is always the name of a RegExp object.
Required by string1. String1 is the string to be replaced by text.
Required by string2.
String2 is a replacement text string.