[Kc] RegExes

Andrew Hanenkamp sterling at hanenkamp.com
Tue Apr 1 12:19:59 PDT 2008


Someday I'll remember the Reply to All button... for public consumption, I'm
resending this to the list... ;)

On Mon, Mar 31, 2008 at 8:34 PM, Emmanuel Mejias <emmanuel.mejias at gmail.com>
wrote:

>   if ($line =~* /\var\/log/*){
>

I think that'd do it. You can also use a different set of separators to make
it a little more readable and avoid the extra escapes:

if ($line =~ m{/var/log}) {

By using the "m" keyword, you can use virtually any symbol you want as the
delimiter for your regex. For example,

m[/var/log]
m"/var/log"
m'/var/log'
m|/var/log|

Cheers,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/kc/attachments/20080401/3eba30e0/attachment.html 


More information about the kc mailing list