How do I do this ?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Ozieo

How do I do this ?

Post by Ozieo »

I have a passwordlist which I want to clear out, like this :

I want to become:

-|(XH19662)|-http://www.kellyashton.com/members/index.htm LOGiN:JOHN55 PASSWoRD:JOHN58
-|(XH19674)|-http://www.newyorkwhores.com/members/ LOGiN:friends PASSWoRD:virginia
-|(XH19675)|-http://www.teeniegals.com/members/ LOGiN:hard PASSWoRD:boner

to become this:

http://JOHN55:JOHN58@www.kellyashton.co ... /index.htm
http://friends:virginia@www.newyorkwhores.com/members/
http://hard:boner@www.teeniegals.com/members/

Can any tell me the exact regular expression for Search & Replace ?

Thanks !
Jeff Epstein

Re: How do I do this ?

Post by Jeff Epstein »

Assuming that you want to get rid of all text following the first space (this is what your example seems to show), then use this replacement expression:


Replace what: \([^ ]+\) .*
Replace with this: \1
[X] Regular Expression

This replaces preserves all text up to but not including the first space, and then obliterates the space and all following text up to the end of the line.

For further regular expresion examples, see my TextPad Regular Expression FAQ.


http://jeffyjeffy.com/textpad/documenta ... n_faq.html

In fact, I'll add your specific question as an example soon

:' )


Jeff
http://www.jeffyjeffy.com/textpad
Randall McDougall

Re: How do I do this ?

Post by Randall McDougall »

Sorry Jeff, have a second look -- he wants to use imbedded logon syntax for the url.

The expression for the line given should be:

Matching RegExp:

^-|.+|-http://\([^ ]+\) +LOGiN:\([^ ]+\) +PASSWoRD:\([^ ]+\)

Replace with:

http://\2:\3@\1
Randall McDougall

Re: How do I do this ?

Post by Randall McDougall »

Sorry Jeff, have a second look -- he wants to use imbedded logon syntax for the url.

The expression for the line given should be:

Matching RegExp:

^-|.+|-http://\([^ ]+\) +LOGiN:\([^ ]+\) +PASSWoRD:\([^ ]+\)

Replace with:

http://\2:\3@\1
Ozieo

Re: How do I do this ?

Post by Ozieo »

Ah Thanks a lot !!

That made it exactly how it needed to be ! :-)

Thank you very much Randall & Jeff !
Jeff Epstein

Re: How do I do this ?

Post by Jeff Epstein »

Ah, yes...

Good call Randall.
Post Reply