MacroToolsVBA icon indicating copy to clipboard operation
MacroToolsVBA copied to clipboard

Confusing Regex-Pattern

Open FiSHonAUT opened this issue 2 years ago • 0 comments

There is this line in the Obfuscation Module: sPattern = "([\s])" & sFinde & "(\_{1}[A-Za-zÀ-ßà-ÿ¨¸]{4,40}(?:\:\s|\n|\r))"

Why exactly is there (?:\:\s|\n|\r)? It breaks the obfuscation when I manually call a control event

e.g.

Private Sub MyCombobox_Change() <== This gets obfuscated correctly
    Do Something
End Sub

Private Sub SomeOtherSub()
    MyCombobox_Change <== This one stays and is not obfuscated, therefore break the code
End Sub

I removed (?:\:\s|\n|\r) and it worked for me. But I wonder if it has an important purpose?

FiSHonAUT avatar Dec 30 '22 12:12 FiSHonAUT