Two Plus Two Older Archives

Two Plus Two Older Archives (http://archives2.twoplustwo.com/index.php)
-   Software (http://archives2.twoplustwo.com/forumdisplay.php?f=43)
-   -   any perl-db/emacs jockeys here? (http://archives2.twoplustwo.com/showthread.php?t=381534)

tinhat 11-19-2005 12:54 PM

any perl-db/emacs jockeys here?
 
Trying to see the result of a regexp such as "m/$str\Z/i" from perl-db (running in emacs buffer); I've tried x/p and m; x/p return status ("1") and I have no idea what m is telling me; any way I can see how this evaluates without using printf in code?

Mike

edit: this is for a perl script to parse hh/pull out "villain c-r <street>"; anyone already done something like this that they'd share? I'll share mine when I'm done but if I don't have to write it I'd rather not...

StevieG 11-20-2005 01:10 PM

Re: any perl-db/emacs jockeys here?
 
What do you want to see?

A regex is evaluated as an expression, like == and therefore the "result" is boolean in nature.

If you want to see what matched, there are special variables for successfull matches.

$& gets the part of the string that matched the regex

$` gets the part of the string before what matched

$' gets the part of the string after what matched


It might help tp see a larger context of what you are doing and what you want.


All times are GMT -4. The time now is 03:43 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.