---
title: "text length"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/11955-text-length"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Organick"
published: "2001-10-04T22:38:00.000Z"
updated: "2001-10-04T23:38:00.000Z"
replies: 1
views: 199
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/11955-text-length"
---

# text length

## #1 — Organick, 2001-10-04T22:38Z

I wounder if anyone here knows how I make a recordset that only shows the first 30 words of maybe 300 words.

Permalänk: https://www.webforum.nu/p/11955

## #2 — LarsG, 2001-10-04T23:38Z

I do not see how you can do it in your select-statement, but using a regexp in VB-script makes it possible.

```
set o = new regexp
o.global = true
o.pattern = "(([a-zA-z0-9])*([\ \,\.])*)"
t = rs("yourColumn")
Set Matches = o.Execute(t)
if matches.count > 29 then i = 29 else i = matches.count

response.write mid(t,1,matches.item(i).firstindex+matches.item(i).length)
```

Probably the pattern may be written in some other manner and you may wish to add some extra characters that delimits words. (I'm rather new to regexp.)

red: Some hatched variable names

Permalänk: https://www.webforum.nu/p/291287

---

Tråden på webben: https://www.webforum.nu/amne/asp/11955-text-length
