import java.util.regex.Pattern;
import java.util.regex.Matcher;

class Ideone {
	private static final String PATTERN_TEMPLATE = "^.*@==(.*?)(?:\\?.*)?$";

	public static void main (String[] args) {
		final Pattern pattern = Pattern.compile(PATTERN_TEMPLATE);

		final String firstTest = 
				"https://e...content-available-to-author-only...e.com/helloworld/.@==imhere";
		final Matcher firstMatcher = pattern.matcher(firstTest);
		if (firstMatcher.matches()) {
			System.out.println(firstMatcher.group(1));
		}
		
		final String secondTest =
				"https://e...content-available-to-author-only...e.com/helloworld/.@==imnothere?param1=value1";
		final Matcher secondMatcher = pattern.matcher(secondTest);
		if (secondMatcher.matches()) {
			System.out.println(secondMatcher.group(1));
		}
	}
}