Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 2
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
2. Regular expressions
  


Understanding the simple substring page 4 of 11


In general, if you are searching for a substring, you can just specify the text verbatim without supplying any "special" characters. The only time you'd need to do anything special would be if your substring contained a +, ., *, [, ], or \, in which case these characters would need enclosed in quotes and preceded by a backslash. Here are a few more examples of simple substring regular expressions:

  • /tmp (scans for the literal string /tmp)
  • "\[box\]" (scans for the literal string [box])
  • "\*funny\*" (scans for the literal string *funny*)
  • "ld\.so" (scans for the literal string ld.so)

Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact