s(world | how)//gi works for the same reason s{world | how}{}gi works The first and second set of regex delimiters do not have to be the same, so in the first instance, the first set of delimiters is () and the second set is //. ----- Original Message ----- From: "Wagner-David" <[EMAIL PROTECTED]> To: "Wagner-David" <[EMAIL PROTECTED]>; "'Daniel Falkenberg'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 20, 2002 1:22 AM Subject: RE: Stripping words from a string
> Though s(world .. worked w/o /, it should be written s/(world | how )//gi; > Perl gurus, why does s(world |how )//gi w/o errors? > > Wags ;) > > -----Original Message----- > From: Wagner-David > Sent: Tuesday, February 19, 2002 21:48 > To: 'Daniel Falkenberg'; [EMAIL PROTECTED] > Subject: RE: Stripping words from a string > > > Put the string in $_ and with > > s(world |how )//gi; > > If you don't take out a space then you get a couple of spaces: > Output(no space part of check (world|how): > Hello are you? > > Output(w/ space part of check above): > Hello are you? > > Wags ;) > -----Original Message----- > From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 19, 2002 21:25 > To: [EMAIL PROTECTED] > Subject: Stripping words from a string > > > Hey all, > > Just wondering how I would go about stripping words from a string. > > If I have a string that has the following... > > $string = "Hello world how are you?"; > > How would I go about stripping the words 'how' and 'Hello' ignoring case > each time? > > Would it go something like the following... > > $string =~ s/.*hello/how\//gi; > > Thx, > > Da > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]