Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function getStations(file_name As String)
  2.  
  3. 'Use Regular Expressiosn for grabbing the input and automatically filter it
  4. Dim regEx As New RegExp
  5.  
  6. With regEx
  7.     .Global = True
  8.     .MultiLine = True
  9.     .IgnoreCase = True
  10.     'This matches the pattern: e.g. 06+900@07+230
  11.    .Pattern = "[0-9]*\+[0-9]{3}\@[0-9]*\+[0-9]{3}"
  12. End With
  13.  
  14. If regEx.Test(file_name) Then
  15.     getStations = regEx.Execute(file_name)(0)
  16. Else
  17.     getStations = "Hay un problema con el nombre. Por favor, arréglalo"
  18. End If
  19.  
  20.  
  21. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement