Wildcards

M

major

Hi,

Can someone tell me what I am doing wrong here. I am trying to find all
instances of the following in my document:
Appendix 3
Appendix 7.6
Appendix 8.8.9.9.9
etc

I want to find using 1 expression. This is what I am using :
(Appendix)([0-9|.| ]@{1,}) and it works fine but doesn't pick all of them.
For example: I have Appendix 8.1.3, Appendix 8.1.4, Appendix 8.1.5, Appendix
8.1.6 So it picks up the first 2, skips the 3rd one and finds the 4th one...I
don't understand why it does that? Can someone help me.

Thank you in Advance.

~ mehj
 
J

Jay Freedman

Hi,

Can someone tell me what I am doing wrong here. I am trying to find all
instances of the following in my document:
Appendix 3
Appendix 7.6
Appendix 8.8.9.9.9
etc

I want to find using 1 expression. This is what I am using :
(Appendix)([0-9|.| ]@{1,}) and it works fine but doesn't pick all of them.
For example: I have Appendix 8.1.3, Appendix 8.1.4, Appendix 8.1.5, Appendix
8.1.6 So it picks up the first 2, skips the 3rd one and finds the 4th one...I
don't understand why it does that? Can someone help me.

Thank you in Advance.

~ mehj

Your syntax has some extra stuff in it, but that shouldn't affect
whether it finds all occurrences.

You can remove the pipe ( | ) characters from the expression in square
brackets. There is no "or" operator for set expressions; all
characters within the brackets are automatically or'ed. Also remove
the @ character. Finally, move the space character from the set to the
position after the word Appendix. This search expression works:

(Appendix )([0-9.]{1,})

See http://www.gmayor.com/replace_using_wildcards.htm for a full
explanation.

However, in my test your original expression also worked, and it found
all occurrences. Check the text where the missed occurrences are,
turning on nonprinting characters if necessary -- maybe there's a
misspelling, or in some other way they don't really match the
expression.
 
M

major

Thanks Jay, you saved my life. I been staring at this document for the past 2
hrs wondering what the heck I was doing wrong:( I just turned on the hidden
characters, turns out there were non-breaking spaces in some text and hence
wasn't matching the expression. It's all taken care of now. Thanks a billion
:)

Jay Freedman said:
Hi,

Can someone tell me what I am doing wrong here. I am trying to find all
instances of the following in my document:
Appendix 3
Appendix 7.6
Appendix 8.8.9.9.9
etc

I want to find using 1 expression. This is what I am using :
(Appendix)([0-9|.| ]@{1,}) and it works fine but doesn't pick all of them.
For example: I have Appendix 8.1.3, Appendix 8.1.4, Appendix 8.1.5, Appendix
8.1.6 So it picks up the first 2, skips the 3rd one and finds the 4th one...I
don't understand why it does that? Can someone help me.

Thank you in Advance.

~ mehj

Your syntax has some extra stuff in it, but that shouldn't affect
whether it finds all occurrences.

You can remove the pipe ( | ) characters from the expression in square
brackets. There is no "or" operator for set expressions; all
characters within the brackets are automatically or'ed. Also remove
the @ character. Finally, move the space character from the set to the
position after the word Appendix. This search expression works:

(Appendix )([0-9.]{1,})

See http://www.gmayor.com/replace_using_wildcards.htm for a full
explanation.

However, in my test your original expression also worked, and it found
all occurrences. Check the text where the missed occurrences are,
turning on nonprinting characters if necessary -- maybe there's a
misspelling, or in some other way they don't really match the
expression.
 
M

major

Hi,

I have another question in regards to this. This doc also has multiple
references, for ex:
Appendix 8.4
Appendices 8.3 and 8.4
Appendices 8.3, 8.4, 8.5 and 8.6

Then again I want to be able to find these using I equation if possible, I
don't want to write multiple equations as I wouldn't know how many references
there will be.

So far I wrote this:
(Appendi[xces]{1,})([^s ])([0-9., and]{1,}) But this also picks up and if
not in a sentence (for ex: Appendix 10.2.2, and) and I don't want that. Is
there a way to work around this?

Thank you!

~ mehj

major said:
Thanks Jay, you saved my life. I been staring at this document for the past 2
hrs wondering what the heck I was doing wrong:( I just turned on the hidden
characters, turns out there were non-breaking spaces in some text and hence
wasn't matching the expression. It's all taken care of now. Thanks a billion
:)

Jay Freedman said:
Hi,

Can someone tell me what I am doing wrong here. I am trying to find all
instances of the following in my document:
Appendix 3
Appendix 7.6
Appendix 8.8.9.9.9
etc

I want to find using 1 expression. This is what I am using :
(Appendix)([0-9|.| ]@{1,}) and it works fine but doesn't pick all of them.
For example: I have Appendix 8.1.3, Appendix 8.1.4, Appendix 8.1.5, Appendix
8.1.6 So it picks up the first 2, skips the 3rd one and finds the 4th one...I
don't understand why it does that? Can someone help me.

Thank you in Advance.

~ mehj

Your syntax has some extra stuff in it, but that shouldn't affect
whether it finds all occurrences.

You can remove the pipe ( | ) characters from the expression in square
brackets. There is no "or" operator for set expressions; all
characters within the brackets are automatically or'ed. Also remove
the @ character. Finally, move the space character from the set to the
position after the word Appendix. This search expression works:

(Appendix )([0-9.]{1,})

See http://www.gmayor.com/replace_using_wildcards.htm for a full
explanation.

However, in my test your original expression also worked, and it found
all occurrences. Check the text where the missed occurrences are,
turning on nonprinting characters if necessary -- maybe there's a
misspelling, or in some other way they don't really match the
expression.
 
J

Jezebel

You'll need to find a way to specify formally the difference between the
ones you want and the ones you don't. If all the ones you want form an
entire paragraph, you can include the paragraph marks in your search:
^013(Appendi....


major said:
Hi,

I have another question in regards to this. This doc also has multiple
references, for ex:
Appendix 8.4
Appendices 8.3 and 8.4
Appendices 8.3, 8.4, 8.5 and 8.6

Then again I want to be able to find these using I equation if possible, I
don't want to write multiple equations as I wouldn't know how many
references
there will be.

So far I wrote this:
(Appendi[xces]{1,})([^s ])([0-9., and]{1,}) But this also picks up and if
not in a sentence (for ex: Appendix 10.2.2, and) and I don't want that. Is
there a way to work around this?

Thank you!

~ mehj

major said:
Thanks Jay, you saved my life. I been staring at this document for the
past 2
hrs wondering what the heck I was doing wrong:( I just turned on the
hidden
characters, turns out there were non-breaking spaces in some text and
hence
wasn't matching the expression. It's all taken care of now. Thanks a
billion
:)

Jay Freedman said:
On Sat, 30 Apr 2005 16:03:28 -0700, "major"

Hi,

Can someone tell me what I am doing wrong here. I am trying to find
all
instances of the following in my document:
Appendix 3
Appendix 7.6
Appendix 8.8.9.9.9
etc

I want to find using 1 expression. This is what I am using :
(Appendix)([0-9|.| ]@{1,}) and it works fine but doesn't pick all of
them.
For example: I have Appendix 8.1.3, Appendix 8.1.4, Appendix 8.1.5,
Appendix
8.1.6 So it picks up the first 2, skips the 3rd one and finds the 4th
one...I
don't understand why it does that? Can someone help me.

Thank you in Advance.

~ mehj

Your syntax has some extra stuff in it, but that shouldn't affect
whether it finds all occurrences.

You can remove the pipe ( | ) characters from the expression in square
brackets. There is no "or" operator for set expressions; all
characters within the brackets are automatically or'ed. Also remove
the @ character. Finally, move the space character from the set to the
position after the word Appendix. This search expression works:

(Appendix )([0-9.]{1,})

See http://www.gmayor.com/replace_using_wildcards.htm for a full
explanation.

However, in my test your original expression also worked, and it found
all occurrences. Check the text where the missed occurrences are,
turning on nonprinting characters if necessary -- maybe there's a
misspelling, or in some other way they don't really match the
expression.
 

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