

It’s a type of code that you can use to search for text, even if you don’t know exactly what that text is. How can you use regex with the Shortcuts app?Īlright, so now you hopefully have a basic idea of what regex is used for. The level of depth that you can use to interact with each of these kinds of functions and how you can combine them make regex an incredibly powerful tool for parsing through and manipulating text.
#Shortcuts app update
Maybe you want to quickly copy them somewhere else, update them to a new format, or replace them so that they all say “ “.Īs you get increasingly proficient and experienced with regex, you’ll be able to do all of these things and more.Īlright, so maybe the examples with email I just gave aren’t that practical. Now, let’s say you not only want to find one email from a paragraph but every email. i.e., a string that follows the “ ” format. If you want to find an email that’s inside of a paragraph, though, and don’t know exactly what that email is, then you’ll need to search for a string of text that’s formatted like an email. And because regex is written in code, you can use it to perform some pretty complex operations.įor example, if you want to search for the word “email”, you can easily write a regex code that searches for email. So put another way, regex is a way to locate a string of text in a larger body of text. For instance, the word ‘green’ is a string of characters from the text “I wore green pants today.” In case you don’t know, a piece of text within another piece of text is called a “string” in programming. What are regular expressions (i.e., regex)?Ī regular expression, or “regex”, is a bit of code that you can use to search for a piece of text inside of a larger piece of text. Start using regex with Shortcuts to take your automation to the next level.Store text strings using the grouping function of regex with Shortcuts.Search for characters at the beginning and end of a string of text.There are a few more quantifiers you’ll want to know about.Use quantifiers to specify the length of text you’re looking for.Wildcards can give you more search options.
#Shortcuts app how to
How to exclude words and characters from your regex searches with Shortcuts.Adding variable components to your regex searches.How to perform a basic text search using regex with Shortcuts.Websites and references to help you start learning regex with Shortcuts.Regex for beginners: Start using regex with Shortcuts.If you don’t want to learn how to use regex with the Shortcuts app, read this.How can you use regex with the Shortcuts app?.What are regular expressions (i.e., regex)?.We’re going to cover the basics of regex (starting with what it is), what you can do with it in the Shortcuts app, some websites and resources you can use if you don’t feel like learning regex yourself, and then we’ll go into the core concepts and mechanics of the regex language. That way, you can get the most out of each of these apps. So in today’s post, you and I are going to learn the ins and outs of regex together. In other words, it wasn’t that these apps were lacking features, but that I was lacking education. And what I discovered was that a lot of the limitations I had been running into with Shortcuts, as well as Automator, could be overcome with regex. Whatever the case, I decided to look further into regex after covering the Shortcuts app over the last few months. Maybe the name scared me off, or maybe it was the code, which is some of the least readable code I’ve ever seen. While I have some background in computer science and programming, I had somehow never come across regex. This is why I wanted to spend this article discussing a very powerful topic: Using regex with the Shortcuts app.


Both are powerhouses when it comes to automation in the Apple ecosystem, and beginning with macOS Monterey this Fall, Shortcuts will be the go-to automation app on all Apple devices. Over the last month or so, I’ve been covering the Shortcuts and Automator apps on iOS and macOS, respectively.
