Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

regex - Regular Expressions and JavaScript: Find digits in last part of string -


i need extract id number string. results given me in following format: "something kind of title (id: 300)" "1, 3, 4 - starts numbers (id: 400)" etc..

these values passed javascript, needs extract id number only, i.e. 300, or 400 in above example.

i still struggling regex, appreciated. can string operations, feet wet regex on actual examples can use. online tutorials i've read far have proven fruitless.

thank you

if number in form (id: ###) \(id: ([0-9]+)\) should regex. brackets around id , number escaped, otherwise considered matching group (as brackets around [0-9]+ are. [0-9] means check character between 0 , 9 , + means 'one or more of'.

var regex = new regexp(/\(id: ([0-9]+)\)/); var test = "some kind of title (id: 3456)";  var match = regex.exec(test); alert('found: ' + match[1]); 

example: http://jsfiddle.net/jonathon/fumhr/

http://www.regular-expressions.info/javascript.html useful resource


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -