So I’m new to regular expressions and having difficulty understanding them. To get my feet wet, I’ve made one that identifies the date with either dashes or slashes. It looks like this:
\d{1,2}[-/]\d{1,2}[-/](\d{4}|\d{2})
I realize it isn’t 100% accurate because hypothetically it would accept 32-96-2012 as the date but that’s fine. This isn’t for homework or work so it doesn’t need to be, I just want to understand simple regexes.
So now I’d like to understand how to search for a specific word, and I’m quite confused. For example, if I wanted to search a text document for the word “soap”, or “Tom”. If anyone could post a simple example and description, I’d appreciate it!
a simple /soap/ or /Tom/ would do it.
more info http://www.codeproject.com/Articles/9099/The-30-Minute-Regex-Tutorial