python - Get number of characters matched in regex -


I have a file indented with a place indentation:

  some text Level 1 level 2 Level1 Level3 and its text   

I want to indent it with 4 spaces. I thought of a regex to match the starting position ^ (\ s) * . However, I do not know how to change it with "Apply a tab for each place".

My estimated output will be:

  Level 1 level 2 with   \ t * len (\ 1)  exists?  Edit:  I appreciate a Regex based solution because I want to use it from within the SibalTimetext Editor, where the replacement performance is done by regex. 

I do not think the Python regex engine supports this, but since you have used the subtitle text, you It can be used, which matches the situation immediately after the end of the last match.

  What to Search: (^ | \) \ s Replace with: \ t   

This pattern will match a single whitespace character, which or line back after immediately starting

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -