Better to search with regular expressions on Mac: If Cmd + F is not enough

0

All programs have a suitable function to search for words in texts. Sometimes you don’t want to find a word somewhere, but look for it right before or after another. Or you want to find passive constructs like “will”, “become”, “become” in all its forms. You can type them all into a search box, but it’s tedious.

You can perform these tasks more easily with regular expressions, also known as regular expressions or RegEx. This means that you no longer define just a search term, but a pattern that you are looking for. Among others, characters such as period, ^, * ,? and $ and round and square brackets. If, on the other hand, you search for such characters with regular expressions, you must prefix them with a backslash ().

Regular expressions are not a new invention: they have been around since the mid-1960s. And, as is so often the case, there are certain dialects, for example in scripting languages ​​such as PHP, Python, JavaScript and Perl or in individual programs such as Emacs, Xcode, BBEdit, Nova and CotEditor (all links see webcode at the end of the article). You can also use regular expressions in Numbers formulas as well as in actions like “Replace Text” and “Match Text” in the shortcut app for iOS / iPadOS, which will also be available on Mac this fall.

  • Access to all heise + content
  • proprietary testing, advice and history: independent, well-founded
  • Read c’t, iX, MIT Technology Review, Mac & i, Make, c’t photography directly in your browser
  • register once – read on all devices – can be canceled monthly
  • first month free, then € 12.95 per month
  • Weekly newsletter with personal reading recommendations from the editor

Start the month FREE

Start your FREE month now

Already subscribed to heise +?

Sign up and read

Register now and read the articles right away

More information about heise +


Source link

Share.

About Author

Leave A Reply