Hi Guys,
Hoping someone might be able to help me with a very basic code I have been having a play with below. I have been using the REGEX (?<=\))(.*?)(?=\[) which i verified online using RegExr and it works fine, and when i use the string below, on the online tester it does extract the appropriate section (in Bold) however in my code it does not appear to do so. Basically i am trying to use this code to extract any text between ) and [. Can anyone see what i am doing wrong in my code for it to never match?
Thanks!
Hoping someone might be able to help me with a very basic code I have been having a play with below. I have been using the REGEX (?<=\))(.*?)(?=\[) which i verified online using RegExr and it works fine, and when i use the string below, on the online tester it does extract the appropriate section (in Bold) however in my code it does not appear to do so. Basically i am trying to use this code to extract any text between ) and [. Can anyone see what i am doing wrong in my code for it to never match?
Thanks!
Code:
("Main","ALERT YGON2 F111111111 G&SC3 SLIPON WGROS1 REQUIRED TANKER WGROT1 REQUIRED 123 SAMPLE RD SUBURB /Road 1 RD //Road 2 RD SVSE 0000 F3 (156728) [B]NITHT1 WARAT1 WGROS1 WGROT1 YGONS1[/B] [WGRO] ")
PHP Code:
Imports System.Text.RegularExpressions
Sub Main(parm as object)
Try
Dim InputStr as String = parm.ToString
if InputStr = Nothing then Exit Sub
Dim regex As Regex = New Regex("(?<=\))(.*?)(?=\[)") 'Has brigades
Dim match As Match = regex.Match(InputStr)
if Match.Success = True
hs.writelog("Appliance Lookup",match.value)
end if
Catch ex As Exception
hs.writelog("Appliance Lookup",ex.Message)
End Try
End Sub
Comment