Search results for 'Regular Expression'. 3 post(s) found.
- 2008/01/25 Javascript based Browser Sniffing
- 2008/01/15 Javascript based Regular Expression Tester
- 2007/09/12 The three simplest regular expressions you will use in PHP
The javascript browser snifer makes an extensive use of Regular Expressions and the search() and match() functions.
By this function, you can know following information:
[1] browser type
[2] browser version
[3] os type
[4] os version
[5] flash installation information
Actually this script is effective when making web log.
The following is the example of Javascript based Browser Sniffing.
<script type="text/javascript" src="js/brwsniff.js"></script>
<script type="text/javascript">
var br=new Array(4);
var os=new Array(2);
var flash=new Array(2);
br=getBrowser();
os=getOS();
flash=hasFlashPlugin();
document.write("Browser identifier: "+br[0]+"<br />");
document.write("Browser version: "+br[1]+"<br />");
document.write("Browser major version: "+getMajorVersion(br[1])+"<br />");
document.write("Browser minor version: "+getMinorVersion(br[1])+"<br />");
document.write("Browser engine: "+br[2]+"<br />");
document.write("Browser engine version: "+br[3]+"<br />");
document.write("Full user agent string: "+getFullUAString()+"<br />");
document.write("Operating system identifier: "+os[0]+"<br />");
document.write("Operating system version: "+os[1]+"<br />");
document.write("Is Flash installed? " + (flash[0]==2 ? "Yes" : (flash[0] == 1 ? "No" : "unknown")) + "<br />");
document.write("Flash version: "+flash[1]+"<br />");
</script>
You can download the latest full script and demo at http://jsbrwsniff.sourceforge.net/
Another posts included in "HTML, Javascript"
| How to include Javascript from anonther ? (0) | 2008/01/25 |
| IFRAME Auto Resize in IE, FireFox by Javascript (13) | 2008/05/03 |
| Clipboard copy function working (0) | 2008/10/17 |
| Javascript based Regular Expression Tester (0) | 2008/01/15 |
| Two useful string functions - substr & substring (0) | 2008/01/15 |
| Is there URLEncode function in Javascript ? (0) | 2007/10/11 |
| Move window (0) | 2007/09/07 |
| How to calculate page loading time ? (0) | 2007/09/07 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/28 23:47
moneyideas
-
Subject different money making ideas
2010/01/29 07:59
moneyideas
-
Subject different money making ideas
2010/01/31 16:43
moneyideas
Here's JavaScript based Regular Expression Tester.
JavaScript (or Microsoft's variant JScript) will need to be enabled in your browser.
Actually this test program is not proper for you to test the complex combination of Regular Expression supported by RegExp function.
function frm1Click()
{
var re = new RegExp(document.frm1.regex.value);
if (document.frm1.subject.value.match(re)) alert("Successful match");
else alert("No match");
}
function show()
{
var re = new RegExp(document.frm1.regex.value);
var m = re.exec(document.frm1.subject.value);
if (m == null) alert("No match");
else
{
var s = "Match at position " + m.index + ":\n";
for (i = 0; i < m.length; i++) s = s + m[i] + "\n";
alert(s);
}
}
function frm1_replace_Click()
{
var re = new RegExp(document.frm1.regex.value, "g");
document.frm1.result.value =
document.frm1.subject.value.replace(re,
document.frm1.replacement.value);
}
// -->
</script>
<form id="frm1" name="frm1" method="post" action="javascript:void(0)">
RegExp<br>
<textarea cols="50" rows="4" name="regex">l(.*?)e</textarea><br />
Subject string<br>
<textarea cols="50" rows="4" name="subject">I love you.</textarea><br />
<p><input value="Test Match" onclick="frm1Click()" type="submit">
<input value="Show Match" onclick="show()" type="submit"></p>
Replacement text<br>
<textarea cols="50" rows="4" name="replacement">hate</textarea><br />
Result<br>
<textarea cols="50" rows="4" name="result">click the button to see the result</textarea><br />
<input value="Replace" onclick="frm1_replace_Click()" type="submit">
</form>
Another posts included in "HTML, Javascript"
| Javascript based Browser Sniffing (0) | 2008/01/25 |
| How to include Javascript from anonther ? (0) | 2008/01/25 |
| IFRAME Auto Resize in IE, FireFox by Javascript (13) | 2008/05/03 |
| Two useful string functions - substr & substring (0) | 2008/01/15 |
| Is there URLEncode function in Javascript ? (0) | 2007/10/11 |
| Move window (0) | 2007/09/07 |
| How to calculate page loading time ? (0) | 2007/09/07 |
| Number Of Vists (0) | 2007/09/07 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 02:24
moneyideas
-
Subject different money making ideas
2010/01/29 10:40
moneyideas
-
Subject different money making ideas
2010/01/31 16:43
moneyideas
The three most basic searches using Regular Expressions are searching for the strings start, the strings end, or for characters it contains. We can do these using the following symbols:
^ indicates the string starts with the specified characters, so "^strcpy" would match any string starting with "strcpy". This would match "strcpy.com is nice" or "strcpy the pirates" but would not match "out and strcpy".
$ indicates that a string finishes with the specified characters, so "strcpy$" would match any string that ended with "strcpy". This what match "What is it strcpy" or "Out and strcpy" but would not match "strcpy.com is nice"
"strcpy" looks for the characters specified within the quotes, anywhere within the string.
This means not only would it match "strcpy.com is nice" and "out and strcpy" it would match "Something about Mary"
These can be combined and used together. Let's say that you only wanted to match the word strcpy, and not any sentances it may be contained in. You might try combining start and end searches like this:
"^strcpy$" This would match only strings that both start and end with strcpy, which applies to a the word "strcpy".
Another posts included in "PHP"
| Adding and Subtracting Time (0) | 2007/09/13 |
| How to remove or set time limit that defined as max_execution_time in p... (0) | 2007/09/18 |
| How to convert formatted date time string to datetime? (0) | 2007/10/12 |
| Send email Message With PHP (0) | 2007/08/26 |
| Array_count_values (0) | 2007/08/26 |
| Calculator with basic four functions (0) | 2007/08/26 |
| Number Format (0) | 2007/08/26 |
| A Function Returns Large Random Numbers (0) | 2007/08/26 |
Trackback : Cannot send a trackbact to this post.
-
Subject Underage pedo incest gir.
2009/01/16 15:25
Teen underage. Underage drinking. Underage. Underage naked. Underage sex stories. Underage sex.
-
Subject Incest comics.
2009/02/06 16:02
Free incest pics. Incest taboo rape photo. Incest. Free incest porn. Mom son incest. Incest porn.
-
Subject Cheapest cialis.
2009/02/11 13:49
Cialis canada. Side effects of cialis. Cialis best price buy online. Cialis.
-
Subject Incest rape.
2009/02/11 18:58
Rape fantasies. Free rape video. Rape stories. Rape sex. Rape story. Stories of rape. Japanese rape. Rape.
-
Subject different money making ideas
2010/01/28 23:20
moneyideas
-
Subject different money making ideas
2010/01/29 07:24
moneyideas
-
Subject different money making ideas
2010/01/31 16:39
moneyideas

jsbrwsniff-0.5.3.zip
Prev

Rss Feed