perlquestion
JimJ
I've got a large database of parts that I need to search. I break all the records into words using :
<p>
<blockquote><tt>
while ( $rec =~ /\b\w+\b/g )
{ $word = $&; }
</tt></blockquote>
<p>
That works well except I don't want it to define a word break as a slash ("/"). This is because a lot of words are notations like: "a/c", "4-5/16", etc. What I'd like to do is redefine what "\b" is. I know that is not possible, but I'm trying to figure out a technique that would let be create something like the "\b" asserion only something I could define. For example, I want to break a word at space, comma, periord, but not slash.
<p>
Also, what characters does the "\b" assertion encompass? Is it any character that is not alpha, digit or underscore?