LibreOffice Calc Userdefine Function for Formula

I am using Ubuntu 22.04 and LibreOffice 24.8.4.2. I don’t have knowledge of any programming language. I want to create two user defined functions from following formulas. Please suggest required changes in the following.

The function ANIRUDDHA is supposed to extract First Name Vs First Name from a cell. Means if A1 cells contains the text State of Maharashtra Vs Aniruddha Purushottamrao Mohod the function will result in State Vs Aniruddha
Function ANIRUDDHA(a)
ANIRUDDHA=REGEX(C3, “((?:(?:\w+.|M/s|Mr.|Shri|Mrs.|P|PSO|Sk|P S O|P S|Md|Sau|Sd|Dr|Ms) )?\w+).* Vs ((?:(?:\w+.|M/s|Mr.|Shri|Mrs.|Sk|Md|Sau|Sd|Dr|Ms) )?\w+).*” , “$1 Vs $2” )
End Function

The function is suppose the show the difference between two dates which are not formatted as dates.
Function MOHOD(a,b)
MOHOD=DATEDIF(DATE(RIGHT(A2,4),MID(A2,4,2) ,LEFT(A2,2) ),DATE(RIGHT(B2,4),MID(B2,4,2) ,LEFT(B2,2) ),“y”) & " Years " & DATEDIF(DATE(RIGHT(A2,4),MID(A2,4,2) ,LEFT(A2,2) ),DATE(RIGHT(B2,4),MID(B2,4,2) ,LEFT(B2,2) ),“ym”) & " Months " & DATEDIF(DATE(RIGHT(A2,4),MID(A2,4,2) ,LEFT(A2,2) ),DATE(RIGHT(B2,4),MID(B2,4,2) ,LEFT(B2,2) ),“md”) & " Days"

End Function