How to do it?

Off-topic posts of interest to the "Everything" community.
Post Reply
salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

How to do it?

Post by salazor » Sun Jul 16, 2017 1:21 pm

How to change this text to such

Code: Select all

mick_74656[MENTION=9015]hotmail[/MENTION].com
to

Code: Select all

mick_74656@hotmail.com
I try replace with regex [MENTION=.*] to @ but not working

ovg
Posts: 130
Joined: Thu Oct 27, 2016 7:19 pm

Re: How to do it?

Post by ovg » Sun Jul 16, 2017 2:12 pm

Try Perl Regex:
find:

Code: Select all

\[(mention).*\]hotmail\[/\1\]
replace with:

Code: Select all

@hotmail

salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

Re: How to do it?

Post by salazor » Sun Jul 16, 2017 2:19 pm

Not quite working because it is next is [MENTION=13551297]aol[/MENTION]
and this command replace on @hotmail

ovg
Posts: 130
Joined: Thu Oct 27, 2016 7:19 pm

Re: How to do it?

Post by ovg » Sun Jul 16, 2017 2:50 pm

Find:

Code: Select all

 \[mention.*\](.*)\[/mention\]
replace with:

Code: Select all

@\1
btw there isn't something about aol or anything else in the first post

salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

Re: How to do it?

Post by salazor » Sun Jul 16, 2017 3:51 pm

This working perfect! - Thanks.

ovg
Posts: 130
Joined: Thu Oct 27, 2016 7:19 pm

Re: How to do it?

Post by ovg » Sun Jul 16, 2017 4:09 pm

You are welcome!

Post Reply