in reply to Re^3: Need help with a nested IF statement
in thread Need help with a nested IF statement

That worked very well. Can you tell me what \b is looking for when you write "/\bnet"? What is considered a Word boundry? Also your split line, what is it doing logic-wise. I am pretty new to Perl and Regex still confuses me slightly. Thanks.

  • Comment on Re^4: Need help with a nested IF statement

Replies are listed 'Best First'.
Re^5: Need help with a nested IF statement
by ikegami (Patriarch) on Nov 02, 2009 at 18:36 UTC

    Can you tell me what \b is looking for when you write "/\bnet"?

    To prevent it from matching "foonet"

    What is considered a Word boundry?

    Between a \W and a \w,
    between a \w and a \W,
    between the start of string and a \w, and
    between a \w and the end of string.

    As a regex pattern:

    /(?<=\w)(?!\w)|(?<!\w)(?=\w)/

    Also your split line, what is it doing logic-wise.

    It splits between a \n and a \w.