--------------------------------------------------------------------------------
gay 'gay'
--------------------------------------------------------------------------------
(?! look ahead to see if there is not:
--------------------------------------------------------------------------------
(?<= look behind to see if there is:
--------------------------------------------------------------------------------
megay 'megay'
--------------------------------------------------------------------------------
) end of look-behind
--------------------------------------------------------------------------------
acht 'acht'
--------------------------------------------------------------------------------
) end of look-ahead
3条答案
按热度按时间h9vpoimq1#
使用方式
字符串
请参阅regex proof。
说明
型
58wvjzkj2#
您可以排除匹配的
megayacht
并匹配包含gay
的单词字符串
regex demo
sauutmhj3#
您可以使用交替模式:
字符串