On Nov 16, 2006, at 11:05 AM, Seth Dillingham wrote:
On 11/16/2006, Frank Mantek said:
a) I could not find anything in the docs about how to best test a
named subpattern. i know how to test an unnamed numbered pattern,
but to make sure the P<function_name> pattern works, i would
really like to test it...
My guess is that by "numbered pattern" you mean "groups" (a.k.a.
captures), and you're testing them by putting a \1 (or whatever) in
the replace pattern.
You can't do that with "named subpatterns," unfortunately. BBEdit's
replace field doesn't understand the names.
I'm not sure that this was the meat of Frank's question. Nonetheless,
BBEdit *does* support named groups in replace patterns, but the
syntax is not currently documented. Until it hits the manual, here's
the short version:
Positional groups, (...), are referred to in the replace pattern as
\1, \2, etc.
Named groups, (?P<word>\w+), are referred to in the replace pattern
as \P<word>.
Jim
--
------------------------------------------------------------------
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]>