Welcome to the Monastery | |
PerlMonks |
Re: Is there a regular expression version of the index function?by rob_au (Abbot) |
on Jun 20, 2004 at 12:16 UTC ( [id://368271]=note: print w/replies, xml ) | Need Help?? |
You can do this using the pos function when performing matching against a string - This function returns the offset of where the last "m//g" search left off for the variable in question ($_ is used when the variable is not specified). The following code demonstrates this function in action:
perl -le "print unpack'N', pack'B32', '00000000000000000000001011100101'"
In Section
Seekers of Perl Wisdom
|
|