LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   using a perl regular expression in php (https://www.linuxquestions.org/questions/programming-9/using-a-perl-regular-expression-in-php-35277/)

markus1982 11-12-2002 12:46 PM

using a perl regular expression in php
 
(problem solved, was just missing a ".") ;)

Syncrm 11-15-2002 02:50 PM

not to really complain... but i was interested in reading the problem/solution.

so could you please keep both in the thread? that way other people can learn from your experience. :-)

markus1982 11-16-2002 04:43 AM

Normally would have done that but it was just a typo, I rechecked the whole thing and found the typo so ... guess you should never code when being to tired ;)

amp2000 11-16-2002 10:00 AM

If it's not too much trouble can you stick the code you removed back in, I'd be interested to see how to use a perl regular expression within PHP;)

Cheers
amp2000

Syncrm 11-18-2002 11:12 AM

Quote:

Originally posted by amp2000
If it's not too much trouble can you stick the code you removed back in, I'd be interested to see how to use a perl regular expression within PHP;)

yes, please do. i'm a perl hacker, and do a little php when necessary, and would like to know how regexes work in php. :-)

on a completely separate note, i have 420 posts! omg weeeeee! ;-)

markus1982 11-18-2002 02:31 PM

Since you are interested in it well the code ...
Code:

preg_match("/^SNMPv2-SMI::enterprises\.9\.2\.4\.9\.1\.4\
.(\d+\.\d+\.\d+\.\d+)\.(\d+\.\d+\.\d+\.\d+) = INTEGER: (\d+)$/", $line, $temp_data);

Just a little bit of SNMP parsing is coming afterwards ... ;)


All times are GMT -5. The time now is 07:24 AM.