KevyTeky
KevyTeky

Reputation: 29

How to insert a colon between a number and a quote?

Source:

9981"TVHeadend HTTP server (web interface)"

and add a colon between to make python dictionaries!

But these are registered known IP address and too many to do one at a time!

I tried replacing the same find and adding the : but it replaced the number with the regex code!

Not ever sure if my code was correct!

Also I want to find the first double quote as you can see each line has two!

Upvotes: 0

Views: 408

Answers (1)

Toto
Toto

Reputation: 91518

  • Ctrl+H
  • Find what: \d+\K(?=")
  • Replace with: :
  • CHECK Wrap around
  • CHECK Regular expression
  • Replace all

Explanation:

\d+             # 1 or more digits
\K              # forget all we have seen until this position
(?=")           # positive lookahead, make sure we have a double quote after

Screen capture (before):

enter image description here

Screen capture (after):

enter image description here

Upvotes: 3

Related Questions