Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ways to perform extraction
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi supputuri,
Thanks for your help.It gave me another way to look at these matching/extraction issues.
Then i Tried this:
strlocation="D:\Documents and Settings\Desktop\New Folder"
Objective: To extract the folder name and the file path from the above location.
For the folder name i tried the following code:
'***********************************
Code:
Set obj=New Regexp
obj.pattern="[A-Z a-z]*$"
obj.global=True
Set num2=obj.execute(d)
msgbox num2.count
For i=0 to num2.count-1
    msgbox num2(i)

Next
'**********************************
Here the problem that i came across is that if i use the pattern as "[A-Z a-z]*$" then it gives two values in the match collection returned by Execute which are :"New Folder" and "".
So then i changed the pattern to "[A-Z a-z ]*$" and it gave me the correct result but the question is by looking at the input it seems that no additional space is there then why is it required in the regular expression?Please clarify.
Reply


Messages In This Thread
Ways to perform extraction - by AAB - 06-01-2012, 04:34 PM
RE: Ways to perform extraction - by AAB - 06-04-2012, 12:22 PM
RE: Ways to perform extraction - by supputuri - 06-04-2012, 06:45 PM
RE: Ways to perform extraction - by AAB - 06-05-2012, 12:36 PM
RE: Ways to perform extraction - by supputuri - 06-05-2012, 09:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Alternate ways to input data Silpa 7 5,377 03-09-2012, 09:28 AM
Last Post: Silpa
  Perform Action on Browser using only VBScript bfakruddin 2 2,742 09-08-2010, 06:57 PM
Last Post: cdesserich
  How to perform the Filter action in excel using vb script? venkatbatchu 6 31,603 10-08-2009, 03:05 PM
Last Post: venkatbatchu
  How many ways we can use external XL sheet data import in to runtime datatable govqa 1 3,460 02-18-2009, 11:09 PM
Last Post: sreekanth chilam

Forum Jump:


Users browsing this thread: 1 Guest(s)