home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

Book HomeLearning Perl, 3rd EditionSearch this book

9.2. Option Modifiers

There are several option modifier letters, sometimes called flags, which may be appended as a group right after the ending delimiter of a regular expression to change its behavior from the default.

9.2.3. Combining Option Modifiers

If you have more than one option modifier to use on the same pattern, they may be used one after the other; their order isn't significant:

if (/\bbarney\b.*\bfred\b/si) {  # both /s and /i
  print "That string mentions Fred after Barney!\n";

9.2.4. Other Options

There are many other option modifiers available. We'll cover those as we get to them, or you can read about them in the perlop manpage and in the descriptions of m// and the other regular expression operators that we'll see later in this chapter.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.