public void saveExpressionToFile(boolean collapse) {
		JFileChooser fileSaveChooser = new JFileChooser("Unnamed Expression.txt");
		FileNameExtensionFilter fnef = new FileNameExtensionFilter("Text Files", "txt");
		fileSaveChooser.setFileFilter(fnef);
		int returnValue = fileSaveChooser.showSaveDialog(this.getRegExInput());
		if (returnValue == JFileChooser.APPROVE_OPTION) {
			File saveFile = fileSaveChooser.getSelectedFile();
			try {
				String saveText = this.getRegExInput().getText();
				if (collapse) {
					saveText = saveText.replaceAll("\n|\t", "");
				}
				String fileName = saveFile.getName();
				String fileAbsolutePath = saveFile.getAbsolutePath();
				String filePath = fileAbsolutePath.substring(0, fileAbsolutePath.lastIndexOf(File.separator));
				if (!fileName.endsWith(".txt")) {
					fileName += ".txt";
				}
				FileUtils.writeStringToFile(new File(filePath + File.separator + fileName), saveText, "utf-8");
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
	}