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
Cannot Replicate FREEBUSY from Exchange 2003 to Exchange 2010 - EVENT 14029, 4003,
Migrate SBS 2003 to Server 2008 R2
How to delete Clonezilla Images
web design vs dev
WebService Client problem
Using VLookup for Data Validation
Is there any way to limit what the users see in shared calendars in Exchange 2003 / Exchange 2007?
OWA 2007: "The administrative limit for this request was exceeded"
The fool says in his heart ...
SBS2008 Folder redirections feature stability ?