Don't get nervous, it's not worth it. 
Of course, I stop writing when I decide.
This is more or less the code posted by 
@stari. I wrote the string value of the Tag, obviously, he didn't; and this code doesn't produce that error.
	
	
	
	
	
	
	
	
	
		Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
  
    Private TappedCard As B4XImageView
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
  
    TappedCard.Tag = "abc_def.png"
  
    Dim card_name As String
    card_name = Regex.Split("_", TappedCard.Tag)(0).Replace("_", " ").Replace(".png", "")
    Log(card_name)
End Sub
	 
	
	
		
	
 
Log:
abc