I need a regular expression that is the simplest regular expression matching with the chemical formula of ions, i.e. chemical formula that finishes with a + or a -, but I couldn