java - how to extract this using regex -
i need extract this
example:
www.google.com maps.google.com maps.maps.google.com
i need extraact google.com
this.
how can in java?
split on .
, pick last 2 bits.
string s = "maps.google.com"; string[] arr = s.split("\\."); //should check size of arr here system.out.println(arr[arr.length-2] + '.' + arr[arr.length-1]);
Comments
Post a Comment