On Wednesday 18 Jul 2007, Harold Fuchs wrote (regarding [users] Regular
Expressions - Defect Using Internal References?):
<SNIPPED>
> Smith John [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Robinson Bill [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Jones Ivan [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
<SNIPPED>
> However, it occurred to me that the problem could be solved using the
> Regular Expression facility within Find & Replace so I set up a small
> example using the three element list above.
>
> The Find and Replace settings I used were (with Regular Expressions
> turned on):
> Find (.* )(.*)
> Replace with \1<\2
<SNIPPED>
Harold,
I see that you have a reply from Donald Locker ("Donald H Locker"
<[EMAIL PROTECTED]>). I agree with Donald that the OOo help system says
explicitly that the \n syntax is only in the Search portion of the RE.
Futher agree that it is a shame, and I'd add that it would have been very
useful to folks who are used to the Unix RE world.....
While I concur that the \n syntax would have been great, there is another way
you can do this using RE:
Checkmark RE box
Search for \<[EMAIL PROTECTED]> #please see note 1 below
Replace with: & <mailto:&> # please see note 2 below
Note 1:
a. The "\<" matches "at start of word boundary"
b. The [a-z._-] matches all lower case letters and the three punctuation
marks (NOTE: I have just put in these from memory, and I have not checked the
RFC for valid characters inside an email address)
c. The ".*" matches zero or more occurrences
d. The "@" is just that, an "at" symbol
e. The "[A-Za-z.] matches any upper/lower characters, or combinations
thereof.
f. The ".*" matches zero or more occurrences of what was matched in (e) above
g. The "\>" matches the "at end of word boundary"
I have not checked the valid combinations for (e) - like (b) above, this is
only a PoC.
Note 2:
The replacement is simple
a. The "&" just puts back what was found
b. The "<mailto" is literal text (can be anything....)
c. The "&" is as in (a)
d. The ">" is literal text.
I admit that this probably does not answer your question on why the "\n"
syntax does not work (refer Don's mail on this), but I trust this would help
you in handling the replacements using RE alone (with due apologies to, as
you so aptly put it, the "Le Maestro des Macros - Andrew Pitonyak.")
--
Pradeep Srinivas
Bangalore, India
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]