?
Solved

VB.NET Regular Expression Function

Posted on 2005-04-11
1
Medium Priority
?
260 Views
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.
0
Comment
Question by:Xexon
1 Comment
 

Accepted Solution

by:
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
        Else
            Return "String not found"
        End If
End Function

You can get some help building your regex expression at
http://regexlib.com/Default.aspx

Harvey
0

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