in reply to Pattern matching regex problem
You are NOT using "pattern matching regex", you are using transliteration.
$s =~ tr/[IOSM]//c says to translate every character NOT in the list '[', 'I', 'O', 'S', 'M' or ']' to itself, and as a side effect return the count of characters modified.
So the string in $s does not contain any characters that are not in the list '[', 'I', 'O', 'S', 'M' or ']'.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pattern matching regex problem
by Anonymous Monk on Nov 23, 2021 at 09:05 UTC | |
by hippo (Archbishop) on Nov 23, 2021 at 10:01 UTC | |
by bibliophile (Prior) on Nov 23, 2021 at 15:00 UTC | |
by ikegami (Patriarch) on Nov 23, 2021 at 21:00 UTC | |
by ikegami (Patriarch) on Nov 23, 2021 at 21:00 UTC | |
by eyepopslikeamosquito (Archbishop) on Nov 24, 2021 at 10:45 UTC |