perl-unicode

Re: In-Band Information Considered Harmful

1998-10-30 13:56:49
Chip Salzenberg wrote :
|| > I didn't see the definition of \m{} either, so here's the one I assume:
|| >   \m{ATTR} -- zero width match that requires the current position to
|| >               have the metadata attribute ATTR defined
|| 
|| I'm glad you asked.  No, I'd define it this way:
|| 
||    \m{ATTR} -- states that subsequent characters can match iff they
||                have metadata that matches ATTR
||    \M{ATTR} -- s/have/do not have/

Don't you need a third one to stop caring?

What if you want to match "good eats" where "good" must be bold,
"eats" need not be bold, and both must be italic?

    /\m{bold}\m{italic}good(\m{bold}|\M{bold}) eats/
                           -------------------
                           this should be easier

-- 
objects:                                    | John Macdonald
    Think of them as data with an attitude. |   jmm(_at_)elegant(_dot_)com