ASP and vbs are followed by URL and other content

Source: Internet
Author: User

<Script language = "vbs">
'Function name: regexptest
'Parameter: strng -- the string to be processed; Various ending signs separated by | in patrn --, such as: <br/>|</P> | <br>; patrn2 -- the string to be replaced with, also |
Open
'Author: Liu yongfa (yongfa365) 'blog
'Function: Randomly Add the content in patrn2 to the end of the character in the strng string

Function regexptest (strng, patrn, patrn2)
Dim RegEx, match, matches 'to create a variable.
Set RegEx = new Regexp 'to create a regular expression.
RegEx. ignorecase = true' specifies whether the characters are case sensitive.
RegEx. Global = true' to set global availability.
Patrn = Split (patrn, "| ")
Foreach P in patrn
RegEx. pattern = P' setting mode.
Strng = RegEx. Replace (strng, "|" & CHR (10) & P)
Next

Strng = Split (strng, "| ")
Foreach e in strng
S = S + E + arrart (patrn2)
Next
Regexptest = s
Endfunction

Function arrart (patrn2)
Arrarti = Split (patrn2, "| ")
Randomize
Arrart = arrarti (CINT (ubound (arrarti) * RND ))
Endfunction

Strng = "111 <br/> 222 </P> 333 <br/> 444 </P> 555 <br> 666 </P> 111"
Source = strng
Patrn = "<br/> | </P> | <br>"
Patrn2 = "www.xiaoshuo8.net | http://www.jb51.net/blog | hi.baidu.com /"
Words = regexptest (strng, patrn, patrn2)
Msgbox (words)

</SCRIPT>

<SCRIPT>
Document. Write "<fieldset> <legend> original string </legend>" + Source + "</fieldset> <br>"
Document. Write "<fieldset> <legend> converted string </legend>" + words + "</fieldset> <br>"
</SCRIPT>

Related Article

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.