Problem with restrict to lines not matching

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

hr
Posts: 2
Joined: Tue Jul 20, 2004 12:17 pm

Problem with restrict to lines not matching

Postby hr » Mon Aug 23, 2004 2:59 pm

I got a problem with restrict to lines not matching.

Restrict line not matching [ > ]
Sub filter Search & replace (Perl Pattern) :
Find pattern :
arp who-has (.*) tell (.*)

Replace
$2,$1,

Sample data:
arp who-has 10.20.1.19 tell bigswitch
linuxbox.50071 > domaincontroller.domain

The result is
,10.20.1.19,bigswitch
linuxbox.50071 > domaincontroller.domain

The result that I want is :
bigswitch,10.20.1.19,
linuxbox.50071 > domaincontroller.domain

Somehow $2 (bigswitch) and $1 (10.20.1.19) is being switched....
I couldn't figure out what's wrong.

Thanks

HR
Netmap Analytics

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Tue Aug 24, 2004 7:48 am

Use a pattern of
arp who-has (.*) tell (.*?)

Otherwise the default non-greedy match stops as soon as it can.

Try turning on prompt on replace in future to help debug these problems.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Guest

Postby Guest » Tue Aug 24, 2004 11:31 am

Simon Carter wrote:Use a pattern of
arp who-has (.*) tell (.*?)

Otherwise the default non-greedy match stops as soon as it can.

Try turning on prompt on replace in future to help debug these problems.


Thanks mate, it's working....
I did turn on the prompt on replace, but could not figure out what's going wrong (non-greedy match).
Probably I need to learn more.

Regards,

HR
Netmap Analytics


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 3 guests