Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to separate a string
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Code:
Dim re, teststring, testresults, showresults
teststring = "Ref123"
Set re = new regexp
re.Pattern = "[aA-zZ]"
re.Global = true
re.IgnoreCase = true
set testresults = re.Execute(teststring)
For each match in testresults
    showresults = showresults + match.value
Next
msgbox showresults

This works as well using regular expressions. The "execute" method returns a collection of all characters in the test string that match the regex pattern, in this case alphas between A and Z upper or lower case. You must then loop through the collection and concatenate each match to a results string.
Reply


Messages In This Thread
How to separate a string - by linhke - 05-28-2010, 03:26 PM
RE: How to separate a string - by guin.anirban - 05-28-2010, 03:50 PM
RE: How to separate a string - by jsknight1969 - 06-04-2010, 01:35 AM
RE: How to separate a string - by basanth27 - 06-07-2010, 02:22 PM
RE: How to separate a string - by jsknight1969 - 06-07-2010, 10:54 PM
RE: How to separate a string - by basanth27 - 06-08-2010, 08:49 AM
RE: How to separate a string - by jsknight1969 - 06-09-2010, 12:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to have a variable that has a string comma string .. shareq1310 5 5,080 11-09-2011, 03:33 PM
Last Post: parminderdhiman84
  string function to get a letter from a string ajay.r1982 3 7,592 06-30-2009, 08:58 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)