Three indispensable REGEX hacks
summary
Three practical regex techniques and a working pattern for the example file set are given: use ^ and $ as anchors to force full-string matches, use grouping and alternation like \.(csv|ods) to match extensions literally (escape the dot), and use character classes with quantifiers like [A-Za-z] to allow any mixed-case name. Concrete pattern for files starting with project and an underscore or dash is ^[Pp]roject[_-][A-Za-z]*\.(csv|ods)$ which matches only project_foo.csv or project-bar.
AI-written summary · about
chapters (5)
- 0:00Start
- 0:27Vanilla Search
- 1:23Carets and Dollars - and
- 1:58Groups and Pipes - () and
- 2:31Square brackets and Asterisks - [ ] and
related talks
57mRegular Expressions, To Match Or Not, That is the Question
39mRegex-Fu
56mHow I learned to stop worrying and love Regex
22mRegex in PowerShell: How to grasp it and why you should grasp it
38mEscape from Planet Regex - Kotlin to the Rescue
34mAn Intuitive Grasp of RegEx’s in Python
59mRegular Expressions
20mBuild your own Swift Regex: A Gentle Introduction to Swift Regex
