The [] special characters enable you to define patterns that match one of a group of alternatives. : bracket « Regular Expression « Perl






The [] special characters enable you to define patterns that match one of a group of alternatives.

    

For example, the following pattern matches def or dEf:

/d[eE]f/

   
    
    
    
  








Related examples in the same category

1.Square brackets ([ and ]) delimits a range of characters.
2.Combine [] with + to match a sequence of characters of any length.
3.The Bracketed Character Class