Microsoft
Software
Hardware
Network
Question : javascrip string parsing question
Suppose I have strings with below format:
Test 07/2010 (Product 10005)
Test 08/2010 (Product 10006)
In this kind of strings, ony the data field (07 and 2010 and 10005) are changed fields, other parts are fixed. How could I parse this kind of string to get value like:
month: 07
year: 2010
Product: 10005
BTW, for string not staring with "Test", then I do not want to parse it.
Many thanks.
Answer : javascrip string parsing question
if (string.match(/^Test/)) {
var month = string.replace(/^Test\ (\d+)\/\d+\ .*$/, '$1');
var year = string.replace(/^Test\ \d+\/(\d+)\ .*$/, '$1');
var Product = string.replace(/^.*Product
\ (\d+)\)$/, '$1');
}
Random Solutions
increase incoming mail size server 2008
We are unable to access database using following parameters.
understanding the GAC
Exchange 2010 Public Folder deletion
How to move exchange2003 to exchange2007
VB.Net String remove everthing after second space in string
PHPList Email Campaign Manager - Mysql Query to get detailed info
SQL Server 2008. Cannot log in the first time after installation.
Problems uninstalling Office 2007
asp.net datalist showing images