広告
rindex は index とよく似ていますが、違う点はSTR 中で最後に見つかった SUBSTR の位置を返すところにあります。POSITION を指定するとPOSITION で指定した位置よりも右でマッチしなおかつ最後にマッチした位置を返します。
$strx = "sevenkey"; print rindex($strx,'e');
27
https://www.7key.jp/program/perl/rindex.html