Android and regex to read substring -


i'm trying use regex in android application read substring. i'm using pattern , matcher, can't figure out how it.

my input string is: javascript:submitform(document.voip_call_log,30,0,'xxxxx','',0,''); xxxxx variable number of digits.

how can read 'xxxxx' using pattern , matcher?

i'm not expert in regex, 1 should work you:

string input = "javascript:submitform(document.voip_call_log,30,0,'5555','',0,'');"; pattern pattern = pattern.compile(",'(\\d*)',"); matcher matcher = pattern.matcher(input); matcher.find(); string out = matcher.group(1); system.out.println(out); 

proof http://ideone.com/wi6vb1


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -