I can't seem to figure this one out. I know that a regular expression can be used, but haven't really had any experience with creating them. I have a string of dates that looks like this:
( (Mon 3:23PM EDT) ( (Thu, Sep 3) ( (Thu, Sep 3) ( (Wed, Sep 2) ( (Tue, Sep 1) ( (Mon, Aug 31) ( (Fri, Aug 28) ( (Wed, Aug 26) ( (Wed, Aug 26) ( (Fri, Aug 21) ( (Mon, Aug 17) ( (Thu, Aug 13) ( (Thu, Aug 13)
When there is a time stamp in the string, such as the 3:23 above, I need to replace that with the today's date. I am getting today's date in the format I need by using the following:
Calendar cal = Calendar.getInstance();
SimpleDateFormat necessaryFormat = new SimpleDateFormat("EE, MMM dd");
String todaysDate = necessaryFormat.format(cal.getTime());
Essentially the string should be
( (Mon, Sep 7) ( (Thu, Sep 3) ( (Thu, Sep 3) ( (Wed, Sep 2) ( (Tue, Sep 1) ( (Mon, Aug 31) ( (Fri, Aug 28) ( (Wed, Aug 26) ( (Wed, Aug 26) ( (Fri, Aug 21) ( (Mon, Aug 17) ( (Thu, Aug 13) ( (Thu, Aug 13)
So far I have tried to use something along the lines of this, but all it is doing is removing the first piece of the string between the parenthesis:
String origStr = links.text().substring(0, links.text().indexOf("("))+
links.text().substring(links.text().indexOf(")")+"))".length());