WildCard

  • Thread starter Lachezar Parvov
  • Start date
L

Lachezar Parvov

Hi. I have a problem with wildcard. I use Ms Word 2003 and use to Find and
replace dialog.

I have current text:

text
[[ text [[ name [ text ]] text ]]
text

I want to find this [[ text [[ name [ text ]] text ]]
I use wildcard and this \[\[*\]\] but Word find this [[ name [ text ]]

Plecae help me how I can find [[ text [[ name [ text ]] text ]]

thank you
 
D

Doug Robbins - Word MVP

Have you tried

\[\[*\[\[*\[*\]\] *\]\]

Note that you have an uneven number of open and closing []

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jean-Guy Marcil

Lachezar Parvov said:
Hi. I have a problem with wildcard. I use Ms Word 2003 and use to Find and
replace dialog.

I have current text:

text
[[ text [[ name [ text ]] text ]]
text

I want to find this [[ text [[ name [ text ]] text ]]
I use wildcard and this \[\[*\]\] but Word find this [[ name [ text ]]

Plecae help me how I can find [[ text [[ name [ text ]] text ]]

Have you tried
\[\[*\]\]*\]\]
???
 
L

Lachezar Parvov

Yes but If I have this

[[alabaa]]

[[text]]

Will find:

"[[alabaa]]

[[text]]"

not

"[[alabaa]]"

"[[text]]"

Jean-Guy Marcil said:
Lachezar Parvov said:
Hi. I have a problem with wildcard. I use Ms Word 2003 and use to Find and
replace dialog.

I have current text:

text
[[ text [[ name [ text ]] text ]]
text

I want to find this [[ text [[ name [ text ]] text ]]
I use wildcard and this \[\[*\]\] but Word find this [[ name [ text ]]

Plecae help me how I can find [[ text [[ name [ text ]] text ]]

Have you tried
\[\[*\]\]*\]\]
???
 
T

Tony Jollans

As far as I can tell you want to find matching outer brackets with zero or
more inner nested sets of bracketed text.

You can't do that with a single pattern in F&R - you'll need to code it up
in VBA and apply some logic.

--
Enjoy,
Tony

Lachezar Parvov said:
Yes but If I have this

[[alabaa]]

[[text]]

Will find:

"[[alabaa]]

[[text]]"

not

"[[alabaa]]"

"[[text]]"

Jean-Guy Marcil said:
Lachezar Parvov said:
Hi. I have a problem with wildcard. I use Ms Word 2003 and use to Find
and
replace dialog.

I have current text:

text
[[ text [[ name [ text ]] text ]]
text

I want to find this [[ text [[ name [ text ]] text ]]
I use wildcard and this \[\[*\]\] but Word find this [[ name [ text ]]

Plecae help me how I can find [[ text [[ name [ text ]] text ]]

Have you tried
\[\[*\]\]*\]\]
???
 
J

Jean-Guy Marcil

Lachezar Parvov said:
Yes but If I have this

[[alabaa]]

[[text]]

Will find:

"[[alabaa]]

[[text]]"

not

"[[alabaa]]"

"[[text]]"

Try:
\[\[*[!^13]\[\[*\]\][!^13]*\]\]

(This message may appear twice, the silly Web interface disconnected me as I
was sending my reply... Don't know if it got through or not..., so I am
sending it it again...)
 
L

Lachezar Parvov

I have currnet text:

[[ text ]]

text

[[text1

]]

text

[[ text [ text ]]

text

[[ text [
text
]]

[[ text [[ text [ text ]] text ]]

I want to find this:

[[ text ]]
and
[[text1

]]

[[ text [[ text [ text ]] text ]]

not
text

and

[[ text [
text
]]

and

[[ text [ text ]]

Tony Jollans said:
As far as I can tell you want to find matching outer brackets with zero or
more inner nested sets of bracketed text.

You can't do that with a single pattern in F&R - you'll need to code it up
in VBA and apply some logic.

--
Enjoy,
Tony

Lachezar Parvov said:
Yes but If I have this

[[alabaa]]

[[text]]

Will find:

"[[alabaa]]

[[text]]"

not

"[[alabaa]]"

"[[text]]"

Jean-Guy Marcil said:
:

Hi. I have a problem with wildcard. I use Ms Word 2003 and use to Find
and
replace dialog.

I have current text:

text
[[ text [[ name [ text ]] text ]]
text

I want to find this [[ text [[ name [ text ]] text ]]
I use wildcard and this \[\[*\]\] but Word find this [[ name [ text ]]

Plecae help me how I can find [[ text [[ name [ text ]] text ]]

Have you tried
\[\[*\]\]*\]\]
???
 
L

Lachezar Parvov

Look this example:
I have currnet text:

[[ text ]]

text

[[text1

]]

text

[[ text [ text ]]

text

[[ text [
text
]]

[[ text [[ text [ text ]] text ]]

I want to find this:

[[ text ]]
and
[[text1

]]

[[ text [[ text [ text ]] text ]]

not
text

and

[[ text [
text
]]

and

[[ text [ text ]]


Jean-Guy Marcil said:
Lachezar Parvov said:
Yes but If I have this

[[alabaa]]

[[text]]

Will find:

"[[alabaa]]

[[text]]"

not

"[[alabaa]]"

"[[text]]"

Try:
\[\[*[!^13]\[\[*\]\][!^13]*\]\]

(This message may appear twice, the silly Web interface disconnected me as I
was sending my reply... Don't know if it got through or not..., so I am
sending it it again...)
 
J

Jean-Guy Marcil

Lachezar Parvov said:
Look this example:
I have currnet text:

[[ text ]]

text

[[text1

]]

text

[[ text [ text ]]

text

[[ text [
text
]]

[[ text [[ text [ text ]] text ]]

I want to find this:

[[ text ]]
and
[[text1

]]

[[ text [[ text [ text ]] text ]]

not
text

and

[[ text [
text
]]

and

[[ text [ text ]]


"Jean-Guy Marcil" wrote:

As Tony suggested, you are now in the realm of macros...

Next time, may I suggest that you post a full sample of the text you are
working with right from the start... This way I would not have wasted your
time posting half-answers...
 

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