1. A method for segmenting text for layout on a web browser, the method comprising: receiving a block of text at a client computer; defining a plurality of regular expressions, wherein a first regular expression in the plurality of regular expressions is used to search for a word or a word boundary; segmenting the block of text into a plurality of text segments, wherein the segmenting comprises: searching the block of text starting at a defined location for a first text segment that matches any of the plurality of regular expressions; adding the first text segment to the plurality of text segments; and updating the defined location to be located at the end of the first text segment within the block of text; and constructing a layout of the block of text using the plurality of text segments.