Re: Searching a string

2004-06-09 Thread John W. Krahn
Sudhindra K S wrote: > > Hi Hello, > I have a string (not a file ) which looks something like this : > > tools : Abcdef > abc: > all: > def: > all: > > Now i want to search the string for all occurances of "all:" and print that line > containing "all:" $ perl -e' my $string =

Re: RE: Searching a string

2004-06-09 Thread sudhindra k s
 Hi Thanks, i tried but i am getting the right output. The problem is if i am putting the same data in a file and then matching the expression it is working fine. But now my data is in a scalar variable and here the matching (m/^all:/) isnt giving me the lines starting with all: Can someone h

RE: Searching a string

2004-06-09 Thread Tim Johnson
perldoc perlre Look at the /s switch for regexes. -Original Message- From: sudhindra k s [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 09, 2004 12:23 AM To: [EMAIL PROTECTED] Subject: Searching a string   Hi I have a string (not a file ) which looks something like this : t

Re: Searching a string?

2001-12-21 Thread Andrea Holstein
TMTWTDI, here's my way: sub check_pass { local $_ = shift; # I assume a sub with one argument the password > > I am new here. But I need to ask what I hope is a relatively easy question. > I am writing a script that checks a password that someone enters. I have > what can be allowed in th

RE: Searching a string?

2001-12-20 Thread Hanson, Robert
Sent: Thursday, December 20, 2001 4:00 PM To: 'Wagner-David'; Batchelor, Scott; '[EMAIL PROTECTED]' Subject: RE: Searching a string? Anywhere I can read up...to find out exactly what is going on in these scripts? I really appreciate the help both of you have given here. T

Re: Searching a string?

2001-12-20 Thread Jeff 'japhy' Pinyan
On Dec 20, Batchelor, Scott said: >1. I am trying to not allow doubled numbers or symbols(e.g. 99 or %%) To ensure a character is not immediately repeated, do !/([^A-Za-z])\1/ That means "not matching 'a non-alpha followed by itself'". >2. Also want to make it so the password has at

RE: Searching a string?

2001-12-20 Thread Batchelor, Scott
ECTED]' Subject: RE: Searching a string? Here is a shot. I am not regex so I was not able to do a single regex for the double characters, why I am pretty sure could be done, but not by me. You need to pull my $MyCnt ; my %MyCnts = (); while ( 1 ) { printf "Please ente

RE: Searching a string?

2001-12-20 Thread Wagner-David
Here is a shot. I am not regex so I was not able to do a single regex for the double characters, why I am pretty sure could be done, but not by me. You need to pull my $MyCnt ; my %MyCnts = (); while ( 1 ) { printf "Please enter password:"; chomp(my $MyPasswd = ); last if ( $My

RE: Searching a string?

2001-12-20 Thread Wagner-David
I tried abb3456djfuh and it never objected. Wags ;) -Original Message- From: Hanson, Robert [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 12:18 To: Wagner-David; 'Batchelor, Scott'; '[EMAIL PROTECTED]' Subject: RE: Searching a string? Oo

RE: Searching a string?

2001-12-20 Thread Hanson, Robert
'Batchelor, Scott'; '[EMAIL PROTECTED]' Subject: RE: Searching a string? He didn't want double digits TOGETHER(ie, 99 is invalid and 98 would be valid) That is the way I read the email request. Wags ;) -Original Message- From: Hanson, Robert [mailto:[EMAIL P

RE: Searching a string?

2001-12-20 Thread Wagner-David
x27;[EMAIL PROTECTED]' Subject: RE: Searching a string? Try this out, it seems to work ok. my @passwords = ("12threefour", "5six7eight", "9ten9ten9ten", "number1"); for ( @passwords ) { my $error = checkPass($_); print ( ($erro

RE: Searching a string?

2001-12-20 Thread Hanson, Robert
Try this out, it seems to work ok. my @passwords = ("12threefour", "5six7eight", "9ten9ten9ten", "number1"); for ( @passwords ) { my $error = checkPass($_); print ( ($error) ? "$error\n" : "Good pass!\n" ); } sub checkPass { my $password = shift; # rejec