ASP to get the content of all the pictures and get the content of the first picture of the code _ application Tips

Source: Internet
Author: User
Copy Code code as follows:

'=====================================
' Get all the pictures in the content
'=====================================
Function get_imgsrc (ByVal t0)
Dim T1,regs,matches,match
T1= ""
IF Not (IsNull (t0) Or Len (t0) =0) Then
Set regs=new REGEXP
Regs.pattern= "]+src=" ([^ ">]+)" "[^>]*>"
Regs.ignorecase=true
Regs.global=true
Set Matches=regs.execute (t0)
IF matches.count>0 Then
For the Match in matches
IF Left (match.submatches (0), 7) <> "http://" Then
t1=t1& "<option value=" "&match.submatches (0) &" ">" &match.submatches (0) & "</option > "
End IF
Next
End IF
End IF
Get_imgsrc=t1
Set matches=nothing
Set regs=nothing
End Function

'=====================================
' Get the first picture in the content
'=====================================
Function frist_pic (ByVal t0)
Frist_pic= ""
Dim regs,matches
Set regs=new REGEXP
Regs.ignorecase=true
Regs.global=true
Regs.pattern= "]+src=" ([^ ">]+)" "[^>]*>"
Set Matches=regs.execute (t0)
IF regs.test (t0) Then
Frist_pic=matches (0). Submatches (0)
End IF
Set matches=nothing
Set regs=nothing
End Function
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.