Showing posts from January, 2012

Using Regular Expressions to Process Texts in Java

Regular expressions make processing texts simpler with less amount of code; on the other hand its syntax confused developers. Counting vowels and consonants, words, sentences etc. in a text, is a good exercise for those beginners who is trying to improve himself/herself in algorithms, a new programming language or both. However, this is also a bit challenging question for even a 2+ years "experienced" programmer; if regular expressions must be used. Some developers, who is programming (and thinking themselves as a best) on java language, don' t know how or when exactly to use regular expressions while coding java in any of J2ME, J2EE or J2SE. Superficial knowledge about fundamentals of java force developers settle for messy java codes such as iterating over array of characters and weird fields of if and loop statements. This increases the complexity of  source code and becomes more difficult to maintain, in later project phases. Regular expressions is widely applicable