In the piece of code bellow, RegExp.Replace will never return. Sentencas[i] = "Test string." Print "Before replacing" Sentencas[i] = RegExp.Replace(Sentencas[i], "[.:!?;]*[ ]*?\n*?", "", RegExp.UTF8) Print "After replacing"
It beats me, because what it should do is very simple: optionally find one of the punction marks (.:?!;) optionally followed by any number of white space, optionally followed by any number of "\n" (end of line). Replace whatever is found with an empty string. In the text string, it should find the dot (.) and replace it with nothing. So, the returned string should be "Test string". Alas! It will never come back. Same if I replace the test string with "Test string. \n" or "Test string.\n" Now, this works as expected, but this is not what I need: "[.:!?;][ ]*?\n*?", "" To my eyes, "[.:!?;]*[ ]*?\n*?" is a perfectly valid regular expression. Any hints? -- Fernando Cabral Blogue: http://fernandocabral.org Twitter: http://twitter.com/fjcabral e-mail: fernandojosecab...@gmail.com Facebook: f...@fcabral.com.br Telegram: +55 (37) 99988-8868 Wickr ID: fernandocabral WhatsApp: +55 (37) 99988-8868 Skype: fernandojosecabral Telefone fixo: +55 (37) 3521-2183 Telefone celular: +55 (37) 99988-8868 Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos, nenhum político ou cientista poderá se gabar de nada. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user