[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] RegEx Redux



Help!

I can't figure out why the following does not work.

	$str = "_MRK:ssdef .HEADLINE=_MRK:align center__MRK:face
plain__MRK:face bold__MRK:size 48__MRK:font Dutch801BT-Roman__";

	$body 		= "\s*([^_]+)";
	$faceMark 	= "_MRK:face$body\_";
	$sizeMark	= "_MRK:size$body\_";
	$fontMark 	= "_MRK:font$body\_";
	$ssdefMark	=
"(_MRK:ssdef\s*([^=]*)=($alignMark|$faceMark|$sizeMark|$fontMark){4,}\_)";

	if ($str =~ m/$ssdefMark/) {
		print "$1";
	}

It produces the following when run.
	_MRK:ssdef .HEADLINE=_

Obviously at this stage I am simply trying to find the entire ssdef marker
in the file.  I intend to break it up and replace with something else but I
can't even get the silly thing to match.  Its probably something simple but
I will be hanged if I can see what it is.

Fred

---------------------------------------------------------------------------
|     Fred Fenimore                         /
|     Box 14604                            /
|     3200 Chapel Hill-Nelson Hwy.        /    THIS SPACE AVAILABLE!
|     RTP, NC 27709-4604                 /
|     voice : 919.558.8880x102          /
|     fax   : 919.558.8889             /
---------------------------------------------------------------------------