Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 523

Need help with regex ( Swapping numbers with regex )

by Audacity - 12 April, 2021 - 12:12 AM
This post is by a banned member (Audacity) - Unhide
Audacity  
Godlike
944
Posts
376
Threads
4 Years of service
#1
I have this : Before ==>
 
Code:
Edit123:Martin564
 
After ==>
 
Code:
Edit564:Martin123
I want to swap the number on the line, if anyone can help, would be appreciated
[Image: Audacity-Signature.gif]
Click on the picture above to get to the shop. One chance in a lifetime.

[Image: Signature.gif]
This post is by a banned member (ANG) - Unhide
This post is by a banned member (MeSvAk) - Unhide
MeSvAk  
Registered
4.014
Posts
3.395
Threads
6 Years of service
#3
(This post was last modified: 12 April, 2021 - 12:45 AM by MeSvAk.)
(12 April, 2021 - 12:22 AM)ANG Wrote: Show More
(12 April, 2021 - 12:12 AM)Audacity Wrote: Show More
I have this : Before ==>
 
Code:
Edit123:Martin564
After ==>
 
Code:
Edit564:Martin123
I want to swap the number on the line, if anyone can help, would be appreciated
I hope you now you can just match it directly as text so for example aa = ....
Bb = .... Then
Print(aa, Bb) if its for one line if were talking about multiple lines and a file just do
Jew = open("something.txt", "r")
for line in Jew:
Parts = line.split(":")
FirstPart = Parts[0]
SecondPart = Parts[1]

Doing this one phone btw you can use regex but its prob overkill anyways I hoped it helped somewhat

Edit I am absolutely retarted smh I thought u needed to switch the two lines for numbers use
re.match('^([\s\d]+)$') with using thr above code so that will be re.match(r'^([\s\d]+)$', SecondPart) for example do this twice I cam up with this on phone plus I am no where near a regex king so :ksz; GL

ur commnets are just funny wtf is that are u ok ? fucking metall shit he ddnt ask for pythong neither fooking $ retard cum and btw u dont needa do that even in python fucking kiddo just impot regex and use commneds sucker

https://imgur.com/qXOm1pc
This post is by a banned member (ANG) - Unhide
This post is by a banned member (MeSvAk) - Unhide
MeSvAk  
Registered
4.014
Posts
3.395
Threads
6 Years of service
#5
(12 April, 2021 - 12:46 AM)ANG Wrote: Show More
(12 April, 2021 - 12:44 AM)MeSvAk Wrote: Show More
(12 April, 2021 - 12:22 AM)ANG Wrote: Show More
I hope you now you can just match it directly as text so for example aa = ....
Bb = .... Then
Print(aa, Bb) if its for one line if were talking about multiple lines and a file just do
Jew = open("something.txt", "r")
for line in Jew:
Parts = line.split(":")
FirstPart = Parts[0]
SecondPart = Parts[1]

Doing this one phone btw you can use regex but its prob overkill anyways I hoped it helped somewhat

Edit I am absolutely retarted smh I thought u needed to switch the two lines for numbers use
re.match('^([\s\d]+)$') with using thr above code so that will be re.match(r'^([\s\d]+)$', SecondPart) for example do this twice I cam up with this on phone plus I am no where near a regex king so :ksz; GL

ur commnets are just funny wtf is that are u ok ? fucking metall shit he ddnt ask for pythong neither fooking $ retard cum and btw u dont needa do that even in python fucking kiddo just impot regex and use commneds sucker

https://imgur.com/qXOm1pc
As I said I am not a regex wizzard I almost never use regex and I am on phone so
dont tag me lq faggot did i ask didi fooking ask ur brain retard fart head
This post is by a banned member (ANG) - Unhide

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 4 Guest(s)