Having two strings as parameters (s1, s2)
I should be able to set up a new Regex(my_regular_expression(s1, s2))
. For example s1="abcd", s2="xyz" I would like to match strings:
regex.IsMatched(x)==true, where x is one of the following:
abcd.xyz
abcd-xyz
xyzabcd
dxy
yzab
z a
dx
cd
but not limited to
but regex.IsMatched(y)==false
, where y is one of the following:
aabcd.xyzv
abd.xyz
xycd
but not limited to
Between s1 and s2 there could be nothing or any character. Any right substring (see the function string.right(string str,int length)
) of s1 concatenated with a left substring (see the function string.left(string str,int length)
) of s2 or any right substring of s2 concatenated with a left substring of s1.
Please use s1 and s2 in regex not abcd, xyz. s1/s2 can contain special characters.
Thank you in advance.