in reply to Metacharacters in regex expression
Update: ishnid is right; I didn't read the index documentation closely enough. Use his code instead. :) Thanks ishnid!my $func_def = "char *strcmp(const char *s1, const char *s2)"; foreach my $i ('char *','const char.*','*') { if (index($func_def,$i)) { print "'$func_def' contains '$i'\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Metacharacters in regex expression
by ishnid (Monk) on Sep 16, 2004 at 09:42 UTC | |
by BrowserUk (Patriarch) on Sep 16, 2004 at 10:17 UTC |