473,771 Members | 2,365 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regular Expressions - Multiline option

I thought I understood this topic rather well until I ran the following procedure

Private Sub Tes
Dim oMatch As Matc
Dim oMC As MatchCollection = Regex.Matches(" abc" & vbCrLf & "abc", "abc$", RegexOptions.Mu ltiline
For Each oMatch In oM
Console.WriteLi ne(oMatch.ToStr ing
Nex
oMC = Regex.Matches(" def" & vbCrLf & "def", "^def", RegexOptions.Mu ltiline
For Each oMatch In oM
Console.WriteLi ne(oMatch.ToStr ing
Nex
End Su

Based upon my understanding, I should get two matches for each loop. Instead the first loop finds one match and the second loop finds two matches. Either I misunderstand something or I would expect the first loop to find two matches. Where am I wrong?
Nov 20 '05 #1
0 1101

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

Similar topics

2
1799
by: Oriana | last post by:
Hi! I'm trying to 'clean up' this source file using regular expressions in Python. My problem is, that when I try to delete extra lines, my code fails. Here's an example.... /** * * Project: MyProject *
5
12081
by: Jeremy R. Harner | last post by:
I've been trying to figure out this for many hours now. I have a file that is in the following format: Game #xxxxxxxxx stuff stuff stuff stuff stuff -----------------------------
3
1413
by: Gianluca | last post by:
Hi, I'm using regular expressions to extract some information from my vb.net source code files. I have something like this: 1: '<class name="xyz" description="xxxxxx"/> 2: Class xyz ... other lines of code ...
2
2475
by: cleo | last post by:
I'm experimenting with Regular Expressions and Windows Forms. Frequently I want a value to be either a valid pattern or empty. For example a Zip code must be 5 digits or may be empty. I know that I can use the Regular Expression "\d{5}" to test for exactly 5 digits. How can I add the option for the string to be empty or must I always test the value before calling the Regular Expression? Thanks
2
2057
by: norton | last post by:
Hi, I am learning Regular Expression and currently i am trying to capture information from web page. I wrote the following code to capture the ID as well as the Title Dim regex = New Regex( _ "viewtopic.php\?t=(?<ID>\d+)""\sclass=""topictitle"">(?<Title>.*)\</a>", _ RegexOptions.IgnoreCase _
1
10067
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol. This program can perform 5 options from a menu on your POP3 mail by logging in with the correct POP3 server along with a user name and password that you use to log in to your ISP. The user name and password as well as the server name are all hard-coded...
1
1297
by: brainstorm | last post by:
Hi, I'm using Borland Delphi .NET 2005 and I've got a problem using Regular Expressions. But the RegExOptions do not work properly. My Replace - function looks like: function TWebForm1.RegExpTags(InputString, Pattern, StringReplacement: String): String; var
20
2377
chunk1978
by: chunk1978 | last post by:
hi everyone... i'm preparing to complete a validated form through client-side javascript with regular expressions... and yes the form will also be validated server-side as well... anyway, my regex code is problematic, and i was wondering if someone who know about regular expressions really well could have a look at it and tell me what is the problem. function checkform ( form ) { if (!/+$/.test(form.name.value)) { alert( "Please...
0
1059
by: AAaron123 | last post by:
The RegexOptions Enumeration contains: Multiline ExplicitCapture Compiled Singleline IgnorePatternWhitespace RightToLeft ECMAScript CultureInvariant
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8934
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.