String (String expression) { int filePathIndex = expression.indexOf(FILE_PATH_MACROS); int lineIndex = expression.indexOf(LINE_MACROS); int columnIndex = expression.indexOf(COLUMN_MACROS); if (filePathIndex == -1) { throw new InvalidExpressionException("Expression must contain " + FILE_PATH_MACROS + " macros."); } expression = StringUtil.replace(expression, FILE_PATH_MACROS, myFilePathRegexp); if (lineIndex != -1) { expression = StringUtil.replace(expression, LINE_MACROS, NUMBER_REGEXP); } if (columnIndex != -1) { expression = StringUtil.replace(expression, COLUMN_MACROS, NUMBER_REGEXP); } return expression; }