Translating that regex into C is trivial: (1) Find rightmost occurence of substring '01' (we are done if there is none), (2) change '01' to '10', (3) reverse the string to the right of that.
Finding the indices of the '1's is also simple.
In reply to Re^3: Odometer pattern iterator (in C).
by hdb
in thread Odometer pattern iterator (in C). (Updated.)
by BrowserUk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |