To count quickly until first match and stop in megastring

I want to count number of characters until the pattern ffffffff57 in megarow (do not read data forward from that point) such that you do not read the whole megarow in in memory.
It should return 120.

Megastring Data


How can you count quickly until the first match?

Source: unix

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.