php-windows Digest 17 Jan 2004 11:26:29 -0000 Issue 2084
Topics (messages 22593 through 22595):
Having trouble with Regular Expressions here too
22593 by: Jim MacDiarmid
22595 by: Svensson, B.A.T. (HKG)
Re: test message
22594 by: Cesar Cordovez
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Here is what I'm doing:
I'm issuing a DOS command on a Windows platform using the backtick mark
(`command`) and getting output from it. That works fine. Now my problem
is parsing the string that gets returned.
I've tried using the preg_match and preg_match_all commands to filter
the information I want, but can't seem to get them to work. I'm not sure
if they are the ones I need to use. I'm attempting to use the following
pattern filter with the preg_match commands:
if (preg_match("/starting./", $output) == 0) {
print "Error logging on to server - unable to get user list.\n";
} else {
array_shift($output);
array_pop($output);
foreach ($output as $line) {
$search_pattern =
"/\s*([^\s]*)\s*AKA\s*\"([^\"]*)\"\s*IN\s*([^\^]*)\^([^\(]*).*/)";
if ( preg_match( $search_pattern, $line, $outarray,
PREG_OFFSET_CAPTURE) > 0) {
print "match found";
} else {
print "Error found\n";
exit;
}
}
}
The above code was taken from a PERL script and modified for PHP.
Data output as follows.. Some information has been blanked out for
privacy reasons.
------- Cut here - Data Begin -----------------------------------
Operator Console (version 0.9.8) for 'XXX.XXX.XXX.XXX' starting.
[UIN] AKA "[USERNAME]" IN [URL^ROOMNAME]
(XXXX:XXXX:XXXX)
Operator Console for 'XXX.XXX.XXX.XXX' signing off
------- Cut here - Data End -----------------------------------
The (XXXX:XXXX:XXXX) in the data above can contain alphanumeric
characters.
The large bit of space between the [UIN] and the AKA is actually in the
real data.
Any suggestions?
Thanks much in advance,
Jim
--- End Message ---
--- Begin Message ---
Would it be possible to do a string position on " AKA " and " IN " and just
cut out what's in between there?
-----Original Message-----
From: Jim MacDiarmid
To: [EMAIL PROTECTED]
Sent: 2004-01-16 17:10
Subject: [PHP-WIN] Having trouble with Regular Expressions here too
Here is what I'm doing:
I'm issuing a DOS command on a Windows platform using the backtick mark
(`command`) and getting output from it. That works fine. Now my problem
is parsing the string that gets returned.
I've tried using the preg_match and preg_match_all commands to filter
the information I want, but can't seem to get them to work. I'm not sure
if they are the ones I need to use. I'm attempting to use the following
pattern filter with the preg_match commands:
--- End Message ---
--- Begin Message ---
...LMAO!!!!!!
Mike Brum wrote:
Not being able to replay is a common problem with VCR's. Please take yours
to a local repair shop or, if it's still under warrantee, you should be able
to send it back to the manufacturer and get free repairs for only the price
of shipping.
Good luck.
-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 2:48 AM
To: '[EMAIL PROTECTED] '
Subject: RE: [PHP-WIN] test message
i can't post!
I can't replay.
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---