StephenRM
Member
The following is the text, I am looking to get the Hebrew/ Greek text and the English text ....
stext = '<heb onclick="w(1,2120)" onmouseover="iw(1,2120)">זֶ֣ה</heb><gloss>this</gloss> <heb onclick="w(1,2121)" onmouseover="iw(1,2121)">סֵ֔פֶר</heb><gloss>letter</gloss> <heb onclick="w(1,2122)" onmouseover="iw(1,2122)">תֹּולְדֹ֖ת</heb><gloss>generations</gloss> <heb onclick="w(1,2123)" onmouseover="iw(1,2123)">אָדָ֑ם</heb><gloss>Adam</gloss> <heb onclick="w(1,2124)" onmouseover="iw(1,2124)">בְּ</heb><gloss>in</gloss> <heb onclick="w(1,2125)" onmouseover="iw(1,2125)">יֹ֗ום</heb><gloss>day</gloss> <heb onclick="w(1,2126)" onmouseover="iw(1,2126)">בְּרֹ֤א</heb><gloss>create</gloss> <heb onclick="w(1,2127)" onmouseover="iw(1,2127)">אֱלֹהִים֙</heb><gloss>god [pl.]</gloss> <heb onclick="w(1,2128)" onmouseover="iw(1,2128)">אָדָ֔ם</heb><gloss>human, mankind</gloss> <heb onclick="w(1,2129)" onmouseover="iw(1,2129)">בִּ</heb><gloss>in</gloss> <heb onclick="w(1,2130)" onmouseover="iw(1,2130)">דְמ֥וּת</heb><gloss>likeness</gloss> <heb onclick="w(1,2131)" onmouseover="iw(1,2131)">אֱלֹהִ֖ים</heb><gloss>god [pl.]</gloss> <heb onclick="w(1,2132)" onmouseover="iw(1,2132)">עָשָׂ֥ה</heb><gloss>[he]+ make</gloss> <heb onclick="w(1,2133)" onmouseover="iw(1,2133)">אֹתֹֽו</heb><gloss>[object marker] +[him]</gloss>'
Dim mat1, mat2 As Matcher
But (mat1.Find), returns FALSE.
stext = '<heb onclick="w(1,2120)" onmouseover="iw(1,2120)">זֶ֣ה</heb><gloss>this</gloss> <heb onclick="w(1,2121)" onmouseover="iw(1,2121)">סֵ֔פֶר</heb><gloss>letter</gloss> <heb onclick="w(1,2122)" onmouseover="iw(1,2122)">תֹּולְדֹ֖ת</heb><gloss>generations</gloss> <heb onclick="w(1,2123)" onmouseover="iw(1,2123)">אָדָ֑ם</heb><gloss>Adam</gloss> <heb onclick="w(1,2124)" onmouseover="iw(1,2124)">בְּ</heb><gloss>in</gloss> <heb onclick="w(1,2125)" onmouseover="iw(1,2125)">יֹ֗ום</heb><gloss>day</gloss> <heb onclick="w(1,2126)" onmouseover="iw(1,2126)">בְּרֹ֤א</heb><gloss>create</gloss> <heb onclick="w(1,2127)" onmouseover="iw(1,2127)">אֱלֹהִים֙</heb><gloss>god [pl.]</gloss> <heb onclick="w(1,2128)" onmouseover="iw(1,2128)">אָדָ֔ם</heb><gloss>human, mankind</gloss> <heb onclick="w(1,2129)" onmouseover="iw(1,2129)">בִּ</heb><gloss>in</gloss> <heb onclick="w(1,2130)" onmouseover="iw(1,2130)">דְמ֥וּת</heb><gloss>likeness</gloss> <heb onclick="w(1,2131)" onmouseover="iw(1,2131)">אֱלֹהִ֖ים</heb><gloss>god [pl.]</gloss> <heb onclick="w(1,2132)" onmouseover="iw(1,2132)">עָשָׂ֥ה</heb><gloss>[he]+ make</gloss> <heb onclick="w(1,2133)" onmouseover="iw(1,2133)">אֹתֹֽו</heb><gloss>[object marker] +[him]</gloss>'
Dim mat1, mat2 As Matcher
Regex:
Try
mat1 = Regex.Matcher(">(\W+)\S<",stext) 'Hebrew / Greek Text
mat2 = Regex.Matcher("<gloss>(\D+)</gloss>",stext) 'English Text
Do While (mat1.Find)
If mat1.GroupCount = mat2.GroupCount Then
For g = 1 To mat1.GroupCount
retText = retText & mat1.Group(g) & " <sub> " & mat2.Group(g) & " </sub> "
Next
End If
Loop
Catch
Log(LastException)
End Try
But (mat1.Find), returns FALSE.