Reputation: 41
Original text is
81277184956 0 31 10000 0 0 0 0 4
afdsf sadfdsf
I want to replace all space with character "|" by regex at Sublime text 2.
Expected result should be
81277184956|0|31|10000|0|0|0|0|4
afdsf|sadfdsf
If i use pattern "\s+", it will match \n too so that two lines change to one line. How to get correct result?
Upvotes: 1
Views: 2986
Reputation: 1
regex=re.compile(' ') a=regex.sub('|',a)
This is how you can easily get the thing done.
Upvotes: 0