Welcome to the Monastery | |
PerlMonks |
How can I use regex to copy each word of a string into a hash?by cei (Monk) |
on Jan 16, 2001 at 06:50 UTC ( [id://52139]=perlquestion: print w/replies, xml ) | Need Help?? |
cei has asked for the wisdom of the Perl Monks concerning the following question:
Say I want to use a regex, instead of split, to build a hash of words in a string. Maybe I want to use /(\w['\w-]*)/g as my word finder. $string is my string. How do I iterate through $string using the regex to build the hash?
Back to
Seekers of Perl Wisdom
|
|