As a long-time R.E. hacker, that is what I would have expected to work as well, but this behaviour is a [documented] bug. If you read the help on regular expressions, it "demonstrates" that the \1-type substitution only applies withing the search string, not in the replacement string. The replacement text is simply that - text.

Dreadfully poor, IMO, but I don't have time to dig into it.
Donald.

Harold Fuchs wrote:
[snip]
The Find and Replace settings I used were (with Regular Expressions turned on):
Find     (.* )(.*)
Replace with    \1<\2

My assumptions were
1. Within the "Find" part
a) the partial RE within the first pair of parentheses would match everything up to and including the *second* space (REs are "greedy") b) the partial RE within the second pair of parentheses would match the email address
2. Within the "Replace" part
a) the "\1" would insert the string matched by the first pair of parentheses (the full name)
b) the "<" would insert the necessary character as per the requirment
c) the "\2" would insert the string matched by the second pair of parentheses (the email address)

Well, The assumptions about the "Find" proved to be correct.
**BUT**
the "\1" and "\2" don't work at all. Instead they are taken **literally** so I ended up with each line in the list being "\1<\2".

IMHO this is completely at odds with how any user of REs would expect them to have been implemented. Writer's Help clearly states that parenthesised sub-expressions can be referred to by \1, \2 etc. The Help does not say that \1, \2 etc. can be used within the replacement string but I've been using them that way on any number of versions of Solaris, UNIX, perl, Java etc. for years.

What am I missing, please? Or is it simply a bug?

Oh, I'm using OO 2.2.1 on Win XP Pro.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to