(.*) ?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngregexp' list.


Rachel Reese
Hi Everyone..
I'm trying to read in a file (sample below) and sort the data (to
eventually be put in a database) based upon whether it's "Local Path",
"Remote Path", etc.

I read in all the lines separately. I get rid of the first few lines
(the ones beginning with "//") with a select case statement and then
have

case else
Dim Expr as string&#":; (.*)"
Dim SearchReg as New RegEx(Expr)
Dim SearchMatch as Match
SearchMatch&#Se;archReg.Match(thisline)
response.write(SearchMatch)
response.write("<BR/>")
sb.append (thisline & "<BR/>")
...
end select

(I was forced to use response.writes because SearchMatch isn't a string
so I couldn't use a trace.write to print it out, apparently....?)

But according to the example in Pro asp.net (page 832) when I search on
"homer(.*)", I'm not supposed to get any occurrence of "homer" in my
results, and I do get the beginning ": " in my results. Should I? How
do I get rid of it?

Or - can you think of a better way to be doing this?

Thanks,
Rachel

//WinMX incomplete downloads
//
//PLEASE DO NOT EDIT THIS FILE

Local Path: C:\My Documents\My Music\NewMusic\Tim Buckley - Strange
Street Affair Under Blue.mp3
Remote Path: c:\dokumente und einstellungen\administrator\eigene
dateien\my music\Tim Buckley - Tim Buckley -04- Strange Street Affair
Under Blue.mp3
Expected Size: 3107655
User: symbiosis
Server: [server5.dtype.org] 64.71.163.205:8888
Entry Time: 08/18/01 12:08:54
Reply to this message...
 
    
Wayne King
A "Match" object represents everything that was matched. In your case, =
you did actually match the colon, so it appears in the output.

Since SearchMatch is not a string, when you do a Response.Write on it, =
it is cast to a string via its ToString() method. And ToString() is =
equivalent to the Value property. So, if you want an explicit string =
from your Match object, use "SearchMatch.Value".

The string you want is within one of the Groups within your SearchMatch =
object. Parenthesized groups are numbered left-to-right starting at =
one. So, this expression should give you the string you want:
    SearchMatch.Groups(1).Value

The docs give a pretty good introduction to how .NET Regexs work:
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconcomregularexpressions.ht=
m

-WayneK

-----Original Message-----
From: Rachel Reese [mailto:Click here to reveal e-mail address]
Sent: Monday, October 08, 2001 9:14 AM
To: aspngregexp
Subject: [aspngregexp] (.*) ?

Hi Everyone....=20
I'm trying to read in a file (sample below) and sort the data (to =
eventually be put in a database) based upon whether it's "Local Path", =
"Remote Path", etc. =20
=20
I read in all the lines separately. I get rid of the first few lines =
(the ones beginning with "//") with a select case statement and then =
have

case else
Dim Expr as string=3D": (.*)"
Dim SearchReg as New RegEx(Expr)
Dim SearchMatch as Match
SearchMatch=3DSearchReg.Match(thisline)
response.write(SearchMatch)
response.write("<BR/>")
sb.append (thisline & "<BR/>")
...
end select

(I was forced to use response.writes because SearchMatch isn't a string =
so I couldn't use a trace.write to print it out, apparently....?)

But according to the example in Pro asp.net (page 832) when I search on =
"homer(.*)", I'm not supposed to get any occurrence of "homer" in my =
results, and I do get the beginning ": " in my results. Should I? How =
do I get rid of it? =20
=20
Or - can you think of a better way to be doing this?

Thanks,
Rachel
=20
=20
//WinMX incomplete downloads
//
//PLEASE DO NOT EDIT THIS FILE
=20
=20
=20
=20
Local Path: C:\My Documents\My Music\NewMusic\Tim Buckley - Strange =
Street Affair Under Blue.mp3
Remote Path: c:\dokumente und einstellungen\administrator\eigene =
dateien\my music\Tim Buckley - Tim Buckley -04- Strange Street Affair =
Under Blue.mp3
Expected Size: 3107655
User: symbiosis
Server: [server5.dtype.org] 64.71.163.205:8888
Entry Time: 08/18/01 12:08:54
=20
=20
=20
| [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID | =
http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT | =
http://www.asplists.com/search =3D SEARCH Archives=20

Reply to this message...
 
    
Rachel Reese
Thanks Wayne.
This worked perfectly!

-Rachel

-----Original Message-----
From: Wayne King [mailto:Click here to reveal e-mail address]
Sent: Monday, October 08, 2001 1:38 PM
To: aspngregexp
Subject: [aspngregexp] RE: (.*) ?

A "Match" object represents everything that was matched. In your case,
you did actually match the colon, so it appears in the output.

Since SearchMatch is not a string, when you do a Response.Write on it,
it is cast to a string via its ToString() method. And ToString() is
equivalent to the Value property. So, if you want an explicit string
from your Match object, use "SearchMatch.Value".

The string you want is within one of the Groups within your SearchMatch
object. Parenthesized groups are numbered left-to-right starting at
one. So, this expression should give you the string you want:
    SearchMatch.Groups(1).Value

The docs give a pretty good introduction to how .NET Regexs work:
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconcomregularexpressions.h
tm

-WayneK

-----Original Message-----
From: Rachel Reese [mailto:Click here to reveal e-mail address]
Sent: Monday, October 08, 2001 9:14 AM
To: aspngregexp
Subject: [aspngregexp] (.*) ?

Hi Everyone....
I'm trying to read in a file (sample below) and sort the data (to
eventually be put in a database) based upon whether it's "Local Path",
"Remote Path", etc.

I read in all the lines separately. I get rid of the first few lines
(the ones beginning with "//") with a select case statement and then
have

case else
Dim Expr as string=": (.*)"
Dim SearchReg as New RegEx(Expr)
Dim SearchMatch as Match
SearchMatch=SearchReg.Match(thisline)
response.write(SearchMatch)
response.write("<BR/>")
sb.append (thisline & "<BR/>")
...
end select

(I was forced to use response.writes because SearchMatch isn't a string
so I couldn't use a trace.write to print it out, apparently....?)

But according to the example in Pro asp.net (page 832) when I search on
"homer(.*)", I'm not supposed to get any occurrence of "homer" in my
results, and I do get the beginning ": " in my results. Should I? How
do I get rid of it?

Or - can you think of a better way to be doing this?

Thanks,
Rachel

//WinMX incomplete downloads
//
//PLEASE DO NOT EDIT THIS FILE

Local Path: C:\My Documents\My Music\NewMusic\Tim Buckley - Strange
Street Affair Under Blue.mp3
Remote Path: c:\dokumente und einstellungen\administrator\eigene
dateien\my music\Tim Buckley - Tim Buckley -04- Strange Street Affair
Under Blue.mp3
Expected Size: 3107655
User: symbiosis
Server: [server5.dtype.org] 64.71.163.205:8888
Entry Time: 08/18/01 12:08:54

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID |
http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT |
http://www.asplists.com/search = SEARCH Archives

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

Reply to this message...
 
    
Rachel Reese
Hi Everyone..
I'm trying to read in a file (sample below) and sort the data (to
eventually be put in a database) based upon whether it's "Local Path",
"Remote Path", etc.

I read in all the lines separately. I get rid of the first few lines
(the ones beginning with "//") with a select case statement and then
have

case else
Dim Expr as string&#":; (.*)"
Dim SearchReg as New RegEx(Expr)
Dim SearchMatch as Match
SearchMatch&#Se;archReg.Match(thisline)
response.write(SearchMatch)
response.write("<BR/>")
sb.append (thisline & "<BR/>")
...
end select

(I was forced to use response.writes because SearchMatch isn't a string
so I couldn't use a trace.write to print it out, apparently....?)

But according to the example in Pro asp.net (page 832) when I search on
"homer(.*)", I'm not supposed to get any occurrence of "homer" in my
results, and I do get the beginning ": " in my results. Should I? How
do I get rid of it?

Or - can you think of a better way to be doing this?

Thanks,
Rachel

//WinMX incomplete downloads
//
//PLEASE DO NOT EDIT THIS FILE

Local Path: C:\My Documents\My Music\NewMusic\Tim Buckley - Strange
Street Affair Under Blue.mp3
Remote Path: c:\dokumente und einstellungen\administrator\eigene
dateien\my music\Tim Buckley - Tim Buckley -04- Strange Street Affair
Under Blue.mp3
Expected Size: 3107655
User: symbiosis
Server: [server5.dtype.org] 64.71.163.205:8888
Entry Time: 08/18/01 12:08:54
Reply to this message...
 
    
Wayne King
A "Match" object represents everything that was matched. In your case, =
you did actually match the colon, so it appears in the output.

Since SearchMatch is not a string, when you do a Response.Write on it, =
it is cast to a string via its ToString() method. And ToString() is =
equivalent to the Value property. So, if you want an explicit string =
from your Match object, use "SearchMatch.Value".

The string you want is within one of the Groups within your SearchMatch =
object. Parenthesized groups are numbered left-to-right starting at =
one. So, this expression should give you the string you want:
    SearchMatch.Groups(1).Value

The docs give a pretty good introduction to how .NET Regexs work:
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconcomregularexpressions.ht=
m

-WayneK

-----Original Message-----
From: Rachel Reese [mailto:Click here to reveal e-mail address]
Sent: Monday, October 08, 2001 9:14 AM
To: aspngregexp
Subject: [aspngregexp] (.*) ?

Hi Everyone....=20
I'm trying to read in a file (sample below) and sort the data (to =
eventually be put in a database) based upon whether it's "Local Path", =
"Remote Path", etc. =20
=20
I read in all the lines separately. I get rid of the first few lines =
(the ones beginning with "//") with a select case statement and then =
have

case else
Dim Expr as string=3D": (.*)"
Dim SearchReg as New RegEx(Expr)
Dim SearchMatch as Match
SearchMatch=3DSearchReg.Match(thisline)
response.write(SearchMatch)
response.write("<BR/>")
sb.append (thisline & "<BR/>")
...
end select

(I was forced to use response.writes because SearchMatch isn't a string =
so I couldn't use a trace.write to print it out, apparently....?)

But according to the example in Pro asp.net (page 832) when I search on =
"homer(.*)", I'm not supposed to get any occurrence of "homer" in my =
results, and I do get the beginning ": " in my results. Should I? How =
do I get rid of it? =20
=20
Or - can you think of a better way to be doing this?

Thanks,
Rachel
=20
=20
//WinMX incomplete downloads
//
//PLEASE DO NOT EDIT THIS FILE
=20
=20
=20
=20
Local Path: C:\My Documents\My Music\NewMusic\Tim Buckley - Strange =
Street Affair Under Blue.mp3
Remote Path: c:\dokumente und einstellungen\administrator\eigene =
dateien\my music\Tim Buckley - Tim Buckley -04- Strange Street Affair =
Under Blue.mp3
Expected Size: 3107655
User: symbiosis
Server: [server5.dtype.org] 64.71.163.205:8888
Entry Time: 08/18/01 12:08:54
=20
=20
=20
| [aspngregexp] member Click here to reveal e-mail address =3D YOUR ID | =
http://www.asplists.com/asplists/aspngregexp.asp =3D JOIN/QUIT | =
http://www.asplists.com/search =3D SEARCH Archives=20

Reply to this message...
 
    
Rachel Reese
Thanks Wayne.
This worked perfectly!

-Rachel

-----Original Message-----
From: Wayne King [mailto:Click here to reveal e-mail address]
Sent: Monday, October 08, 2001 1:38 PM
To: aspngregexp
Subject: [aspngregexp] RE: (.*) ?

A "Match" object represents everything that was matched. In your case,
you did actually match the colon, so it appears in the output.

Since SearchMatch is not a string, when you do a Response.Write on it,
it is cast to a string via its ToString() method. And ToString() is
equivalent to the Value property. So, if you want an explicit string
from your Match object, use "SearchMatch.Value".

The string you want is within one of the Groups within your SearchMatch
object. Parenthesized groups are numbered left-to-right starting at
one. So, this expression should give you the string you want:
    SearchMatch.Groups(1).Value

The docs give a pretty good introduction to how .NET Regexs work:
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconcomregularexpressions.h
tm

-WayneK

-----Original Message-----
From: Rachel Reese [mailto:Click here to reveal e-mail address]
Sent: Monday, October 08, 2001 9:14 AM
To: aspngregexp
Subject: [aspngregexp] (.*) ?

Hi Everyone....
I'm trying to read in a file (sample below) and sort the data (to
eventually be put in a database) based upon whether it's "Local Path",
"Remote Path", etc.

I read in all the lines separately. I get rid of the first few lines
(the ones beginning with "//") with a select case statement and then
have

case else
Dim Expr as string=": (.*)"
Dim SearchReg as New RegEx(Expr)
Dim SearchMatch as Match
SearchMatch=SearchReg.Match(thisline)
response.write(SearchMatch)
response.write("<BR/>")
sb.append (thisline & "<BR/>")
...
end select

(I was forced to use response.writes because SearchMatch isn't a string
so I couldn't use a trace.write to print it out, apparently....?)

But according to the example in Pro asp.net (page 832) when I search on
"homer(.*)", I'm not supposed to get any occurrence of "homer" in my
results, and I do get the beginning ": " in my results. Should I? How
do I get rid of it?

Or - can you think of a better way to be doing this?

Thanks,
Rachel

//WinMX incomplete downloads
//
//PLEASE DO NOT EDIT THIS FILE

Local Path: C:\My Documents\My Music\NewMusic\Tim Buckley - Strange
Street Affair Under Blue.mp3
Remote Path: c:\dokumente und einstellungen\administrator\eigene
dateien\my music\Tim Buckley - Tim Buckley -04- Strange Street Affair
Under Blue.mp3
Expected Size: 3107655
User: symbiosis
Server: [server5.dtype.org] 64.71.163.205:8888
Entry Time: 08/18/01 12:08:54

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID |
http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT |
http://www.asplists.com/search = SEARCH Archives

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com