So this is just a challenge for the perversely curious.
($random_char) = "string" =~ /your_magic_here/s;
update: I was a bit hasty...
"string" =~ /(?=(?>^.*(?{$n=int rand$+[0]})))(??{".{$n}"})(.)/s
In reply to Pick a random string char with a regex by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |