Regular expression matching

Hi, my Regex code below doesn’t work but could not found the problem…
Is way of using “Regex” wrong?

var hoge (datatable)
row(0){“I like an apple very much”,“Bob”}

var piyo (datatable)

System.Text.RegularExpressions.Regex.IsMatch(piyo(0)(0).ToString, “(.)(hoge(0)(0).ToString)(.)” )

message box “it works!”
//do nothing


Check this link, you can test your regex expression by passing values to it.

Looks like you’re actually looking to match (. )(hoge(0)(0).ToString)(. ) at the moment. If you want to pass variables into the pattern I think you should change it to:

System.Text.RegularExpressions.Regex.IsMatch(piyo(0)(0).ToString, “(.)(“+hoge(0)(0).ToString+”)(.)” )

I’m not 100% sure if that works, you can also try making a new string variable called ‘pattern’ and assigning “(.)(“+hoge(0)(0).ToString+”)(.)” to it.