Parse Regular Expressions

Source: Internet
Author: User

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.

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.