Sublime Forum

One-by-one replace doesn't work with specific regex

#1

I thik I may have found a bug.

Here’'s some sample text:
aa aohs sioajas oaidsj asoidj joiajsd asioj oijsadoijioj asdoij oij
oasidjoi aadsijaso adoijadso adoijas asdoija sdioja sdoij ads aiosjd

Now press Ctrl+H, Alt+R (to enable regex mode)

For “Find What” enter this: (?<= )([a-z]+)
For “Replace With” enter whatever you want.

Now you should see all the matched words marked with a border. You can cycle through the matches by pressing F3 and each match will be highlighted, one by one.

However, if you’d press Ctrl+Shift+H for the “Replace one” action, it will fail.

It seems that the problem lies within the regex containing positive lookbehind (?<= ) component. As soon as it is replaced with something less fancy, say, ( ), the one-by-one replacing using Ctrl+Shift+H will work just fine.

0 Likes