one optimization that i didn’t mention in the previous post but exists in both versions is skip acceleration. almost all serious regex engines have some form of this - the idea is simple: many states will self-loop on the majority of input bytes. for example, .* loops back to itself on every byte except \n - so why run the DFA transition 999 times when you can look up a whole chunk of the input in parallel and jump directly to the next \n? going back to the matching loop pseudocode from the previous post:
Credit: Patrick Wymore / HBO。业内人士推荐新收录的资料作为进阶阅读
,详情可参考新收录的资料
SelectWhat's included
ITmedia �r�W�l�X�I�����C���ҏW�������삷���������[���}�K�W���ł�。业内人士推荐新收录的资料作为进阶阅读