P
Pascal
I changed my mind in the maner of spliting a text into word to surround then
by a tag.
here is what i tried based on a javascript i use:
'This is what i use in javascript. How i can do this in vbnet?
'txt = txt.replace(/([\wéçâêîôûà èùëï]+)(?=[\s'".,;!?«»\-(\)])/gi,'<spanclass=\'blue\' onclick="verif(this)">$1<\/span>');
I tried something like this: but the pattern seems to have to be different
in vbnet
Private Sub BtnRegx_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) _
Handles BtnRegx.Click
Dim input As String = TextBox1.Text
Dim pattern As String = "[\w]+ (?=[\s '.,;!?«»\-(\)])"
Dim replacement As String = "<span class=""blue""
onclick=""verif(this)"">" + input + "</span>"
Dim rgx As New Regex(pattern)
Dim result As String = rgx.Replace(input, replacement)
TBoxRegx.Text = result
End Sub
Does someone knows th good pattern in vb?
thanks in advance
by a tag.
here is what i tried based on a javascript i use:
'This is what i use in javascript. How i can do this in vbnet?
'txt = txt.replace(/([\wéçâêîôûà èùëï]+)(?=[\s'".,;!?«»\-(\)])/gi,'<spanclass=\'blue\' onclick="verif(this)">$1<\/span>');
I tried something like this: but the pattern seems to have to be different
in vbnet
Private Sub BtnRegx_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) _
Handles BtnRegx.Click
Dim input As String = TextBox1.Text
Dim pattern As String = "[\w]+ (?=[\s '.,;!?«»\-(\)])"
Dim replacement As String = "<span class=""blue""
onclick=""verif(this)"">" + input + "</span>"
Dim rgx As New Regex(pattern)
Dim result As String = rgx.Replace(input, replacement)
TBoxRegx.Text = result
End Sub
Does someone knows th good pattern in vb?
thanks in advance