On Aug 20, 2007, at 12:30 PM, BBEdit-Talk List wrote:

I realize this is a silly request, but I've not found an answer --

I need to reverse the type of a selection.

E.g.,


markstanley     needs to become  yelnatskram

and I have a long list of these.  Surely there's an easy fancy grep-
tastic mechanism that escapes me.

Find
(.)(.)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?) (.?)(.?)(.?)

Replace
\20\19\18\17\16\15\14\13\12\11\10\9\8\7\6\5\4\3\2\1


But seriously, this isn't really something that grep is suitable for. I
would use a filter.  Here's one in Perl that reverses each line in the
selection individually:

#!perl -pl

$_ = reverse $_;

__END__


And this one reverses the whole selection as a single entity:

#!perl -pl

BEGIN { $/ = undef }

$_ = reverse $_;

__END__


HTH,
Ronald


Ronald,

Thx. It does. I'm not very good with Perl -- or not as good as I should be. I'll have to dig deeper or go write some php tools


<?php
echo strrev("p.vail");
?>

should output:  liav.p

I keep forgetting that not everything needs to be done in my text editor, but I was hopin'!

vail

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to