fork download
  1. Imports System
  2. Imports System.Text.RegularExpressions
  3.  
  4. Public Class Test
  5. Public Shared Sub Main()
  6. Dim Verbs() As String = FindVerbs("I am playing with my helicopter. It's flying very fast.")
  7.  
  8. Console.WriteLine(Verbs(0)) 'Prints "play"
  9. Console.WriteLine(Verbs(1)) 'Prints "fly"
  10. End Sub
  11.  
  12. Public Shared Function FindVerbs(ByVal Input As String) As String()
  13. Dim Matches As MatchCollection = Regex.Matches(Input, "\p{L}+(?=ing[^\p{L}])", RegexOptions.IgnoreCase)
  14. Dim ReturnArray(Matches.Count - 1) As String
  15. For x As Integer = 0 To Matches.Count - 1
  16. ReturnArray(x) = Matches(x).Value
  17. Next
  18. Return ReturnArray
  19. End Function
  20. End Class
Success #stdin #stdout 0.11s 25368KB
stdin
Standard input is empty
stdout
play
fly