.Net version of PHP's preg_match
I've built some code in PHP before which reads a string of data and finds relevant parts based on selected criteria being a "match"
How can I do this in .net (VB)?
for example my string might be
B/E1297G
where the B/ with up to 6 charters is a order number?
Re: .Net version of PHP's preg_match
are you familiar with regex?
vb.net Code:
Imports System.Text.RegularExpressions
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim s As String = "some text B/E1297G some more text"
MsgBox(New Regex("\sB\/[A-Z]{1}\d{1,4}[A-Z]{1}\s").Match(s).Value)
End Sub
End Class