One way...
Option Explicit
Dim strStartPos
Dim strEndPos
Dim strLength
Dim strMaxLength
Dim strFullText
Dim strText
Dim strSearchString
Dim i
Sub Get4Paragraphs(strFullText)
strSearchString = "</p>"
strStartPos = 0
strLength = 0
strEndPos = 1
strMaxLength = Len(strFullText)
'In case we don't have 4 paragraphs
On Error Resume Next
For i = 1 to 4
'Find the end of the Paragraph
If strEndPos <= strMaxLength then
strStartPos = strEndPos
strEndPos = instr(strStartPos, strFullText, strSearchString) + Len(strSearchString)
End If
Next
'If there's an error, we probably didn't find 4 pararagraphs,
'so we'll print everything we did find
If Err <> 0 Then
strEndPos = strMaxLength
Response.write strMaxLength & "Error<br>"
End if
'Pluck the string out of the Original text
Response.write mid(strFullText,1,strEndPos -1)
End Sub
'Mainline Code
strFullText = "<p>Paragraph 1</p><p>Paragraph 2</p><p>Paragraph 3</p><p>Paragraph 4</p><p>Paragraph 5</p>"
Get4Paragraphs(strFullText)