Regular expressions play an important role in basic text processing tasks like tokenization and normalization. They provide a formal language for specifying text patterns that can be used to search for and manipulate strings. For tasks like sentence segmentation, more complex models like decision trees are often used to classify whether a period indicates the end of a sentence or not based on multiple features of the preceding and following words. While hand-coding rules is possible for simple problems, machine learning is generally used to automatically learn the classification rules from annotated training data since it can handle many complex feature combinations.