User Tools

Site Tools


ops102:regular_expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ops102:regular_expressions [2025/03/14 02:05] – [Examples] chrisops102:regular_expressions [2025/04/01 04:42] (current) – [Using Regular Expressions] chris
Line 105: Line 105:
 =====  Using Regular Expressions  ===== =====  Using Regular Expressions  =====
  
-Regular expressions can be used in many places:+Regular expressions can be used in many places, including:
  
   *  Linux   *  Linux
-    *  GNU grep+    *  GNU ''grep''
     *  The bash test command ''<nowiki>[[ "string" =~ regexp ]]</nowiki>''     *  The bash test command ''<nowiki>[[ "string" =~ regexp ]]</nowiki>''
       * Note that the regular expression is __not__ quoted       * Note that the regular expression is __not__ quoted
       * Example: ''<nowiki>X="ABC"; if [[ "$X" =~ ^[[:upper:]]{3}$ ]]; then echo "MATCH" ; else echo "NO MATCH" ; fi</nowiki>''       * Example: ''<nowiki>X="ABC"; if [[ "$X" =~ ^[[:upper:]]{3}$ ]]; then echo "MATCH" ; else echo "NO MATCH" ; fi</nowiki>''
-    *  The less command, using the / and ? keystrokes for searching forward and backward +    *  The ''less'' command, using the / and ? keystrokes for searching forward and backward 
-    *  The vi/vim editor, also using the / and ? keystrokes for searching forward and backward +    *  The ''vi''/''vim'' editor, also using the / and ? keystrokes for searching forward and backward 
-    *  The sed and awk utilities+    *  The ''sed'' and ''awk'' utilities
  
   *  Windows   *  Windows
-    *  findstr /R (see notes below)+    *  ''findstr /R'' (see notes below)
  
   *  Programming Languages (Cross-Platform)   *  Programming Languages (Cross-Platform)
ops102/regular_expressions.1741917938.txt.gz · Last modified: 2025/03/14 02:05 by chris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki