Da Warriah
07-16-2003, 01:21 PM
i just recently learned regexps, and so im having a bit of trouble with them...im trying to make a PHP browser detector, and i have most of it worked out, but im trying to figure out a way to find the difference between netscape and mozilla...heres Netscape's user agent, um, thing:
Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
and here's Mozilla (Firebird)'s:
Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6
now how do i use a regexp to determine whether a browser is mozilla or not, either searching for "Mozilla" twice, or making sure "Netscape" and "MSIE" are not listed inside the user agent...thanx for the help:)
Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
and here's Mozilla (Firebird)'s:
Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6
now how do i use a regexp to determine whether a browser is mozilla or not, either searching for "Mozilla" twice, or making sure "Netscape" and "MSIE" are not listed inside the user agent...thanx for the help:)