Word 2003: Search and Replace Question...

A

Andrey Kazak

Greetings!

The idea is to select all words in round brackets, for example:

(word to be selected)

I try to use standard Word Search and Replace Use wildcards functionality:
\(([A-Za-z]@[ \)])@

I get error, while manual combinations:
\([A-Za-z]@[ \)] - for one word in round brackets;
\([A-Za-z]@[ \)][A-Za-z]@[ \)] - for two words in round brackets;
\([A-Za-z]@[ \)][A-Za-z]@[ \)][A-Za-z]@[ \)] - for three words in round
brackets;
etc...

work normally...

Could you help me please to figure out the problem and the way to cope with
it?
 
P

Paul B

Greetings!

The idea is to select all words in round brackets, for example:

(word to be selected)

I try to use standard Word Search and Replace Use wildcards functionality:
\(([A-Za-z]@[ \)])@

I get error, while manual combinations:
\([A-Za-z]@[ \)] - for one word in round brackets;
\([A-Za-z]@[ \)][A-Za-z]@[ \)] - for two words in round brackets;
\([A-Za-z]@[ \)][A-Za-z]@[ \)][A-Za-z]@[ \)] - for three words in round
brackets;
etc...

work normally...

Could you help me please to figure out the problem and the way to cope with
it?

Does \([a-z A-Z]@\) work for you? The space in the character
range expression seems to be crucial.

p.
 
A

Andrey Kazak

Thank you!

Could you explain me please in more detail what in my original notation is
wrong:

\(([A-Za-z]@[ \)])@

And also, one small related question:
Can I select all words in brackets, BUT excluding brackets itself?
 
P

Paul B

I'm far from an expert on this, and very frankly, after working
with regular expression engines such as Perl's, Word's search
engine and it documentation drives me batty.

It looks to me that you were looking for one or more instances of
a word followed by a space and a right parenthesis.

As for eliminating the brackets, I think you'd have to do that
via macro. The Find result would be converted to a Range and then
manipulated. But I'll have to defer to someone else on this.

bw,
p.


Thank you!

Could you explain me please in more detail what in my original notation is
wrong:

\(([A-Za-z]@[ \)])@

And also, one small related question:
Can I select all words in brackets, BUT excluding brackets itself?


Paul B said:
On Thu, 11 Jun 2009 11:48:01 -0700, Andrey Kazak wrote:

Does \([a-z A-Z]@\) work for you? The space in the character
range expression seems to be crucial.

p.
 
G

grammatim

Thank you!

Could you explain me please in more detail what in my original notation is
wrong:

\(([A-Za-z]@[ \)])@

When Paul said "The space in the character range expression seems to
be crucial," he meant that you left the space between Z and a out of
the formula.
And also, one small related question:
Can I select all words in brackets, BUT excluding brackets itself?



Does \([a-z A-Z]@\) work for you? The space in the character
range expression seems to be crucial.
 
A

Andrey Kazak

It's still not clear for me about what is wrong...
Could you provide any more details please?

Is it correct to search:
[A-Za-z]@[ \)]

???
or not legal?...
 
G

grammatim

YOU HAVE TO HAVE A SPACE BETWEEN THE A-Z GROUP AND THE a-z GROUP.

(It might be clearer if you didn't keep deleting everyting that
prceded the last message you're responding to.)

It's still not clear for me about what is wrong...
Could you provide any more details please?

Is it correct to search:
[A-Za-z]@[ \)]

???
or not legal?...



Paul B said:
It looks to me that you were looking for one or more instances of
a word followed by a space and a right parenthesis.
grammatim said:
When Paul said "The space in the character range expression seems to
be crucial," he meant that you left the space between Z and a out of
the formula.-
 
A

Andrey Kazak

I've always thought that that it's not nescesarry to insert a space between
ranges:
http://www.gmayor.com/replace_using_wildcards.htm
http://word.mvps.org/FAQs/General/UsingWildcards.htm
http://office.microsoft.com/en-us/word/HA012303921033.aspx

Is it a bug or a special rule (workaround)?

grammatim said:
YOU HAVE TO HAVE A SPACE BETWEEN THE A-Z GROUP AND THE a-z GROUP.

(It might be clearer if you didn't keep deleting everyting that
prceded the last message you're responding to.)

It's still not clear for me about what is wrong...
Could you provide any more details please?

Is it correct to search:
[A-Za-z]@[ \)]

???
or not legal?...



Paul B said:
It looks to me that you were looking for one or more instances of
a word followed by a space and a right parenthesis.
grammatim said:
When Paul said "The space in the character range expression seems to
be crucial," he meant that you left the space between Z and a out of
the formula.-
 
G

Graham Mayor

It is not necessary to include a space between ranges, unless you want to
search for a space in the string - as here.
The error message that you get with your string is caused by the final @ to
avoid that move the space to your search string range
\(([A-Z a-z]@[\)])
and omit the @. The square brackets are then superfluous thus
\(([A-Z a-z]@\))
as are the round brackets, unless you wish to use them in replace string
thus
\([A-Z a-z]@\)
These alternatives will find any number of words between round brackets
(unless there is punctuation between the brackets).

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Andrey said:
I've always thought that that it's not nescesarry to insert a space
between ranges:
http://www.gmayor.com/replace_using_wildcards.htm
http://word.mvps.org/FAQs/General/UsingWildcards.htm
http://office.microsoft.com/en-us/word/HA012303921033.aspx

Is it a bug or a special rule (workaround)?

grammatim said:
YOU HAVE TO HAVE A SPACE BETWEEN THE A-Z GROUP AND THE a-z GROUP.

(It might be clearer if you didn't keep deleting everyting that
prceded the last message you're responding to.)

It's still not clear for me about what is wrong...
Could you provide any more details please?

Is it correct to search:
[A-Za-z]@[ \)]

???
or not legal?...



:
It looks to me that you were looking for one or more instances of
a word followed by a space and a right parenthesis.
:
When Paul said "The space in the character range expression seems
to be crucial," he meant that you left the space between Z and a
out of the formula.-
 
A

Andrey Kazak

Thank you, Graham!

But why the final @ in my notation caused the error?
Because of a bug, or I used wrong syntax?

Graham Mayor said:
It is not necessary to include a space between ranges, unless you want to
search for a space in the string - as here.
The error message that you get with your string is caused by the final @ to
avoid that move the space to your search string range
\(([A-Z a-z]@[\)])
and omit the @. The square brackets are then superfluous thus
\(([A-Z a-z]@\))
as are the round brackets, unless you wish to use them in replace string
thus
\([A-Z a-z]@\)
These alternatives will find any number of words between round brackets
(unless there is punctuation between the brackets).

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Andrey said:
I've always thought that that it's not nescesarry to insert a space
between ranges:
http://www.gmayor.com/replace_using_wildcards.htm
http://word.mvps.org/FAQs/General/UsingWildcards.htm
http://office.microsoft.com/en-us/word/HA012303921033.aspx

Is it a bug or a special rule (workaround)?

grammatim said:
YOU HAVE TO HAVE A SPACE BETWEEN THE A-Z GROUP AND THE a-z GROUP.

(It might be clearer if you didn't keep deleting everyting that
prceded the last message you're responding to.)

On Jun 12, 10:59 am, Andrey Kazak
It's still not clear for me about what is wrong...
Could you provide any more details please?

Is it correct to search:
[A-Za-z]@[ \)]

???
or not legal?...



:
It looks to me that you were looking for one or more instances of
a word followed by a space and a right parenthesis.
:
When Paul said "The space in the character range expression seems
to be crucial," he meant that you left the space between Z and a
out of the formula.-
 
A

Andrey Kazak

I'm still staying in the dark about such Word search function behaviour...

Graham Mayor said:
It is not necessary to include a space between ranges, unless you want to
search for a space in the string - as here.
The error message that you get with your string is caused by the final @ to
avoid that move the space to your search string range
\(([A-Z a-z]@[\)])
and omit the @. The square brackets are then superfluous thus
\(([A-Z a-z]@\))
as are the round brackets, unless you wish to use them in replace string
thus
\([A-Z a-z]@\)
These alternatives will find any number of words between round brackets
(unless there is punctuation between the brackets).

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Andrey said:
I've always thought that that it's not nescesarry to insert a space
between ranges:
http://www.gmayor.com/replace_using_wildcards.htm
http://word.mvps.org/FAQs/General/UsingWildcards.htm
http://office.microsoft.com/en-us/word/HA012303921033.aspx

Is it a bug or a special rule (workaround)?

grammatim said:
YOU HAVE TO HAVE A SPACE BETWEEN THE A-Z GROUP AND THE a-z GROUP.

(It might be clearer if you didn't keep deleting everyting that
prceded the last message you're responding to.)

On Jun 12, 10:59 am, Andrey Kazak
It's still not clear for me about what is wrong...
Could you provide any more details please?

Is it correct to search:
[A-Za-z]@[ \)]

???
or not legal?...



:
It looks to me that you were looking for one or more instances of
a word followed by a space and a right parenthesis.
:
When Paul said "The space in the character range expression seems
to be crucial," he meant that you left the space between Z and a
out of the formula.-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top