Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. public static void main(String[] args) {
  2. System.out.println(from3rd("harsh harsh"));
  3. }
  4.  
  5. private static Pattern p = Pattern.compile("(/[^/]*){2}harsh([^/]*)");
  6.  
  7. public static String from3rd(String in) {
  8. Matcher m = p.matcher(in);
  9.  
  10. if (m.matches())
  11. return m.group(2);
  12. else
  13. return null;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement