473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

System.Text.RegularExpressions Class

Using regular expression testers such as Expresso or Dan Appleman's tester,
I have a regular expression that tests fine and is returning matches.
However, when the same regex is run through code, the same code that is
returning the matches in the tester, no matches are found. The only
difference is that the in the tester, the source to run the regex against
are placed into a texbox (string array) and in the code the source is
generated from a web request into a string object.

Has anyone had any similar issues?

Thanks
Chris
Nov 19 '05 #1
2 2536
Hello,

"chris fink" <ch********@decisionone.com> schrieb:
I have a regular expression that tests fine and is returning matches.
However, when the same regex is run through code, the same code that is returning the matches in the tester, no matches are found. The only
difference is that the in the tester, the source to run the regex against are placed into a texbox (string array) and in the code the source is
generated from a web request into a string object.


Post some code.

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #2
Hello Herfried,

I'm having the same problem and it's driving me crazy. This code does
not work when run but works in 2 expression evaluators.

Chris

Sub test()
Dim testString As String = "Me.Button1.Name = 'Button1'"
Dim regVars As New Regex( _
"(?:^\s*)(?<name>.*)\s*=\s*(?<value>.*)(?=\r\n )", _
RegexOptions.IgnoreCase _
Or RegexOptions.Multiline _
Or RegexOptions.Compiled _
)
Dim regMC As MatchCollection = regVars.Matches(testString)
If regMC.Count > 0 Then
MsgBox("Success")
End If
End Sub
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Juan | last post by:
Hi, I´m using System.Text.RegularExpressions, I want to find any acurrence of the char & or % or | Ehat is the correct sintax for the Match method? This is what I´m usinf but is not working:...
2
by: Doug | last post by:
I'm a little confused by this functionality. It doesn't seem to be behaving like it should. I am using the following regular expression to validate email addresses:...
8
by: Richard Lionheart | last post by:
Hi All, I tried using RegEx, but the compiler barfed with "The type of namespace 'RegEx' could not be found. Prior to this, I had the same problem with MatchCollection, but discovered it's...
0
by: Neo The One | last post by:
I find some of the Regex classes are quite helpful for my learning. For example: System.Web.RegularExpressions.SimpleDirectiveRege...
0
by: Vikram | last post by:
I am using regex class in codebehind to validate some control's text. But for checking , postback is done.I want to avoid postback and check the same exprseeion using regularexpressionvalidator. I...
0
by: Jim Duffie | last post by:
Hi, I am trying to build a simple websire using the above in Visual Web Developer. When finished I have build the website and it works fine locally but when I FTP it to the server I am getting a...
2
by: AnalogKid17 | last post by:
Keywords: ASP.NET app with VS2005 running on Win2003 with IIS6, and SQL2000 on a WinXP Box I've betting the following for days... it's driving me insane: Server Error in '/' Application. ...
9
by: Arpan | last post by:
If I am not wrong, System.IO is one of the seven namespaces that get imported in all ASP.NET page automatically but in the following code: <%@ Import Namespace="System.IO" %> <script...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
9
by: garyusenet | last post by:
I am using a C# solution that somebody kindly sent me. It was a console application. I am trying to get use of the MessageBox. I have added the following using directive to the namespaces at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.