VB.NET Regular Expression Function

Posted on 2005-04-11
Medium Priority
Last Modified: 2010-04-17
Hello everyone,

Can anyone give me some hints on writing a VB.NET function in .NET that will receive an argument as a string (the string is a text file's data that has been read in previously), and
will parse for something such as  _XYZsomething here_XYZ (using a regular expression) and return the string something here?

 Thank you.
Question by:Xexon
1 Comment

Accepted Solution

topsailnet earned 1000 total points
ID: 13769102
This will give you some place to start

Private Function parseRegEx(ByVal stringToParse As String) As String
        Dim stringToFind As Regex = New Regex(" put your expression here ")
        If InStr(stringToParse, stringToFind.ToString) Then
            Return stringToFind.ToString
            Return "String not found"
        End If
End Function

You can get some help building your regex expression at


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question