i need to find all values that resides between two asterisk symbol *data1* *data2* *data3* *data4* *data5*how do i set Regular Expression in java for this particular string. 
i tried indexof ..but it ain't  work
            Asked
            
        
        
            Active
            
        
            Viewed 111 times
        
    -1
            
            
         
    
    
        sarath kumar
        
- 134
- 4
2 Answers
0
            
            
        this works fine...
String pattern = "\*([^*^\s*$]+)\*";
Pattern pt = Pattern.compile(pattern);
Matcher mat = pt.matcher(data);
 
    
    
        sarath kumar
        
- 134
- 4
-1
            
            
        To find only the values (without the asterisks). (Not find values completely blank):
(?<=\*)(\s*[^*\s]+\s*)
 
    
    
        JGomez
        
- 1
- 3
- 
                    Why 'This answer is not useful'? It's the only that finds 'values'. – JGomez Oct 24 '15 at 18:21