I am currently using this regex substitution string on an html, to match all English words in some lines and enclose them into a <bdo dir="ltr"> tag.
The reason I need to do this is because the site has both Arabic and English characters, and the Arabic ones need to be enclosed in a <bdo dir="rtl"> tag, since Arabic is read from right to left.
So I am using this regex substitution:
.,.+2s/\(\<\w*\>\)/<bdo dir="ltr">\1<\/bdo>/g
Is there a better way to go about this?