fork download
  1. Imports System
  2. Imports System.Text.RegularExpressions
  3.  
  4. Public Class Example
  5. Public Shared Sub Main()
  6. Dim pattern As String = "(?<=if\s+""%testfile%""\s*==\s*)"".*?""(?=\s+\()"
  7. Dim input As String = "if ""%testfile%"" ==""abcd"" ( "
  8. Dim options As RegexOptions = RegexOptions.Multiline
  9.  
  10. For Each m As Match In Regex.Matches(input, pattern, options)
  11. Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index)
  12. Next
  13. End Sub
  14. End Class
  15.  
Success #stdin #stdout 0.05s 19552KB
stdin
Standard input is empty
stdout
'"abcd"' found at index 19.