Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Public Function simpleCellRegex(Myrange As Range) As String
  2. Dim regEx As New RegExp
  3. Dim strPattern As String
  4. Dim strInput As String
  5. Dim strReplace As String
  6. Dim strOutput As String
  7.  
  8.  
  9. strPattern = "<a\b([^>""']|""[^""]*""|'[^']*')+\bclass=""changed-by"">.*?<\/a>"
  10.  
  11. If strPattern <> "" Then
  12. strInput = Myrange.Value
  13. strReplace = ""
  14.  
  15. With regEx
  16. .Global = True
  17. .MultiLine = True
  18. .IgnoreCase = False
  19. .Pattern = strPattern
  20. End With
  21.  
  22. If regEx.Test(strInput) Then
  23. simpleCellRegex = regEx.Replace(strInput, strReplace)
  24. Else
  25. simpleCellRegex = "Not matched"
  26. End If
  27. End If
  28. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement