This program includes support for Perl style Regular Expressions which are quite common and are used by some R packages. I personally prefer the RegExRx app, which should work on OSX and Windows and is available either as a shareware version or as a paid app on the Apple App Store. One simple way to do this is to use an online app with a graphical interface that highlights matches, such as the one provided here. If you want to get started using regular expressions, you can check out the tutorials posted above, but I have also found it very helpful to just start trying out examples and seeing how they work. What is important to understand is that they can be far more powerful than simple string matching. You can start by checking out this link to an overview of regular expressions, and then take a look at this primer on using regular expressions in R. If you want build your competency with text analysis in R, they are definitely a necessary tool. They are foundational to lots of different text processing tasks where we want to count types of terms (for example), or identify things like email addresses in documents. Regular expressions are a way of specifying rules that describe a class of strings (for example - every word that starts with the letter "a") that are more succinct and general than simply generating a dictionary and checking against every possible value that meets some rule. You can check out examples here, but download it from the first link above.
0 Comments
Leave a Reply. |