3 ms·
The (?i) is a confusing part of that example expression, and I don't see why it's necessary.
by suivix 15y ago
The (?i) is a confusing part of that example expression, and I don't see why it's necessary.
- walrus 15y agoThe (? ... ) syntax is for "extended patterns". In this case, it makes the rest of the regular expression case insensitive. Read through http://perldoc.perl.org/perlre.html#Extended-Patterns http://perldoc.perl.org/perlre.html#Extended-Patterns for more information on extended patterns.
- zedshaw 15y agoWhich one? That might be an error.
- rcthompson 15y agoI think it's the one on the "cover page" (the one linked to from HN.
- irahul 15y agoIt's good to know about it. Earlier at an employer we had a system where a processor in the pipeline took regular expressions as input - you can pass regular expressions but not the flags. (?i) is the only way you can indicate case-insensitive in these cases.