![]() (The pipe character is the vertical line that is most likely found on the same key as the backslash on your keyboard.) A list separated by pipes says, "find any one of these things i.e., this OR that OR the other thing." Fortunately, we can account for these quite easily: we'll simply put all of the possibilities in a single set of parentheses, separated by pipes. So far, so good, but now it occurs to us that a cat might be referred to as a feline, or a kitten, or a kitty (the plural of which would be kitties). To do this, we use a question mark (?), which means "find zero or one of the thing that comes before this question mark." So the optional "s" is represented by s?, and the new query says, "find a word boundary, followed by 'cat', followed by either an 's' or no 's', followed by another word boundary." We could remove the word boundary from the end of "cat," but then we'd still find "category"! The solution is to include an optional "s" at the end of the word. Now we have a new problem: we've eliminated "category" and "locate," but we've also excluded the word "cats," which we certainly want to find, if we're looking for cat dreams. A word boundary represents the spot where a letter or number meets a space, apostrophe, a period, or anything else that isn't a letter or number it's represented in the DreamBank search engine (but not in the rest of the world!) by a ^ symbol (the standard \b also works). ![]() So, we refine our query by looking for a word boundary on either side of the word. Unfortunately, this will also pull up dream reports that contain the words "category," "scathing," "locate," etc. Let's say we want to find all the dream reports that include a mention of a cat. This tutorial shows you exactly how you can use a few of the regular expression codes to perfect a search. An introductory tutorial on regular expression searches.The DreamBank search engine lets you use the complete set of regular expressions (with a few exceptions) in your searches, so that you can refine your queries to find exactly what you want. Regular expressions are a set of codes that are used to match patterns of letters in many programming languages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |