Reply To: Having GREP problems

#95309
Peter Kahrel
Participant

Something went wrong earlier, a whole line of code disappeared (and what is a leekahead, one wonders). This is what it should have been:

To find Greek immediately following some Latin character, place Latin in a lookbehind:

[\x{0000}-\x{00FF}\x{0100}-\x{024F}\x{1E00}–\x{1EFF}]\K[\x{1F00}-\x{1FFF}\x{0370}-\x{03FF}]+

And/or to find Greek immediately followed by a Latin character, place the Latin in a lookahead:

[\x{1F00}-\x{1FFF}\x{0370}-\x{03FF}]+(?=[\x{0000}-\x{00FF}\x{0100}-\x{024F}\x{1E00}–\x{1EFF}])

> This means that it will also find all the instances of space between two Greek words?

It does and it doesn’t. It would now match spaces between Greek words, but it doesn’t match Greek words separated by spaces (or punctuation, for that matter). So those grep expressions need some tweaking.

This article was last modified on June 11, 2017

Comments (0)

Loading comments...