Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11520

Re: How to economically(!) remove a range of unknown(!) characters from a string

Newsgroups microsoft.public.scripting.vbscript
Subject Re: How to economically(!) remove a range of unknown(!) characters from a string
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References (7 earlier) <586d2174$0$21413$e4fe514c@news.xs4all.nl> <XnsA6F3B95E884CBeejj99@194.109.6.166> <586d5fe5$0$21542$e4fe514c@news.xs4all.nl> <XnsA6F45BE1E689eejj99@194.109.6.166> <586e00b5$0$21542$e4fe514c@news.xs4all.nl>
Date 2017-01-05 10:10 +0100
Message-ID <XnsA6F4676E1F356eejj99@194.109.6.166> (permalink)

Show all headers | View raw


"R.Wieser" <address@not.available> wrote on 05 Jan 2017 in 
microsoft.public.scripting.vbscript:

>> you could try to learn by experiment and
>> reading the specs.
> 
> :-)   There is an end to my ability to absorb stuff.   And it looks like
> that RegExp simply isn't sticking to my wetware.  And believe me, I've
> tried.
> 
> I've got several programs that use it, including PHP. 

[in PHP a programme?]

> I can create
> expressions all I want, but quite often the result surprises me.

I will pretend you asked for help here:

I wrote:
> Set myRegExp = New RegExp
> myRegExp.Pattern = "^(.{" & RangeBegin & "}).{" & Range & "}"
> sText = myRegExp.replace(sText,"$1")
> response.write sText

Now:

"^(.{6}).{2}"

means:

^ start matching at the beginning of the string
. match any single character
.{6} match group of 6 of any single character
(.{6}) remember this group for pasting as $1
.{2} match group of 2 of any single character

.replace(sText,"$1")

will do:

replace the first 8 characters [the "match"]
with the first 6 remembered.

so if
sText = "12345678"
the returned string wil be:
"123478"

====================

"^(.{6}).{2}"

could also be written as:

"^(......).."

but then it would be [more] difficult 
to insert the numbers 6 and 2 dynamicly
as I did here:

"^(.{" & RangeBegin & "}).{" & Range & "}"

==============


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to microsoft.public.scripting.vbscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 13:40 +0100
  Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-03 08:43 -0500
    Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 17:21 +0100
      Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-03 19:33 -0500
        Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 10:36 +0100
          Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 12:21 +0100
            Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-04 08:31 -0500
              Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 17:27 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-04 18:13 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-04 21:53 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 00:33 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-05 09:19 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 10:10 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 10:34 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-05 11:50 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 09:44 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 16:50 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-05 17:29 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 11:50 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-04 22:57 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 09:54 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 04:51 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 12:17 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 09:38 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 13:11 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-05 22:42 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 17:35 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-06 00:46 +0100
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-05 21:03 -0500
                Re: How to economically(!) remove a range of unknown(!) characters from a string "Mayayana" <mayayana@invalid.nospam> - 2017-01-05 18:41 -0500
  Re: How to economically(!) remove a range of unknown(!) characters from a string Ulrich Möller <knobbi38@arcor.de> - 2017-01-03 15:03 +0100
    Re: How to economically(!) remove a range of unknown(!) characters from a string Ulrich Möller <knobbi38@arcor.de> - 2017-01-03 15:26 +0100
      Re: How to economically(!) remove a range of unknown(!) charactersfrom a string "R.Wieser" <address@not.available> - 2017-01-03 17:33 +0100
    Re: How to economically(!) remove a range of unknown(!) charactersfrom a string "R.Wieser" <address@not.available> - 2017-01-03 17:26 +0100
  Re: How to economically(!) remove a range of unknown(!) characters from a string "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-03 15:06 +0100
    Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 17:29 +0100
  Re: How to economically(!) remove a range of unknown(!) characters from a string "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-01-03 11:17 -0500
    Re: How to economically(!) remove a range of unknown(!) characters from a string "R.Wieser" <address@not.available> - 2017-01-03 17:39 +0100

csiph-web