Microsoft
Software
Hardware
Network
Question : get value in string - Jquery based & Regular Expression
Hello, I'm being really braind dead here today.. I need to grad a value out of a file.
It looks like this
Version 1.6.7 - Teremba Bay
--------------------------
---
- #3999 Upload a file with apostrophe make problem
- #4137 small text typo in admin/login.php
Version 1.6.6 - Bonde
--------------------------
---
- #3777 Documentation Error: redirect_url plugin
- #3923 Adminlog download, tab separator single quoted
...
and on and on
all I want to do is get the top, the first Version in this case '1.6.7'
I'm strating off with this...
var jQ = jQuery.noConflict();
jQ.get('doc/CHANGELOG.txt'
, function(data) {
var re = new RegExp(/(?:Version)\s+(.*?
)\-(.*?)/)
;
var m = re.exec(data);
if (m == null) {
alert("No match");
} else {
alert(m[0]);
}
so alert(m[0]); should have in this case alerted '1.6.7'
Thank you.. cheers..
Answer : get value in string - Jquery based & Regular Expression
The matched value is in the index: 1
See below:
1: 2: 3: 4: 5:
if (m == null) { alert("No match"); } else { alert(m[1]); }
Random Solutions
Exception processing does not intersept error.
Cisco VPN Client 5.0.07.0290 on Windows 7 64 bit
Sum if from access data base
canonical equations where minima or maxima have second derivative = 0
SWFAddress and .htaccess?
us domain
Can't login to Lacie d2
How do I delete some lines in a text file?
Can't Import javax.tv.Xlet within Java ME project class
Web site works using IP but not Localhost