I haven't tested it, but would try:
\(\d+|\w+\)$Change to:[leave empty]
Yes, that oughta work as well, but Chandasz was on the right track:
-- the '+' makes the expression "\w" repeat, and (as Jeremy correctly states) the $ marks the end of a paragraph.
Initially I typed "\([\d\w]+?\)$", but then I realized it's not necessary to create an OR group with decimals and word characters -- digits are also in ID's set of word characters. Parentheses are not, so there is no need to use the notation "+?" for a shortest possible match.
Hmmm. Still not working. I tried them both and it says "cannot find match"
Here is a sample of the text with what I want to be able to search for bolded....
authority on all 16 separate construction contracts being prepared for the project. (2002/2010/AECOM)
1 person found this helpful
Try this : \([\d\u/]+\)
Ooooh. We're getting there....
I changed it a bit as it wasn't looking for the end of a paragraph...
But NOW it is finding only some... it found:
Yeah, but that's just because you keep on changing what you want to find!
-- add the hyphen as the first element, so ID won't think you mean 'from .. to'.
The uppercase \u is not necessary because this is included in \w 'all word characters'.
Yay!! It's working!!! You are amazing. Thank you. You have made many people happy today
Now that expression is not working on this one....
Chicago Public Schools E-Rate Program, Chicago, Illinois. Program manager for a $175 million, 2-year information technology upgrade program at more than 400 schools, including systems design, facility infrastructure improvements and the installation of conventional and wireless components. (1999 – 2001)
It is not finding the (1999 - 2001)
I need to find something that will find any sort of text or numbers and punctuation within parenthesis at the end of a paragraph....
Any other ideas? You guys are great!
That looks like an en- or possibly em-dash (it rtightfully should be an en-dash and not a hyphen when descibing a range), and it's surrounded by spaces, at least in the example.
This is true. That is not controllable by me since these are imported source files from a database. They are likely to be a variety of things...
Is it possible to have an expression to cover anything at all that may appear in parenthesis at the end of a paragraph?
With this \(.+\)$ you can find anythink in parenthesis at the end of a paragraph
From the very first opening bracket in that paragraph, which may be a bit too much. Use
to find the shortest possible string in parentheses at the end of a paragraph.
That's what you'd think, but in this case, mysteriously, \(.+?\)$ and \(.+\)$ are equally greedy. It turns out that what you need is this:
i.e. an opening parenthesis up to a paragraph-final closing parenthesis without any intervening opening parens.
"Bien vu". It is strange. There are greedy with End of Paragraph, location ($) and marker (\r).
I noticed that and thought, "hey, I must have made a mistake". File it as bug?
> File it as bug?
The problem is not with the end-of-paragraph marker or any other positio marker, but rather that GREP appears not to be so good at looking back. Remember the designed-as limitation of lookbehinds, whose matches must be the same length.
The expression gets the wrong results with any "delimiter". E.g. in "ugh (abc) grrr (xyz)# ouch", the expression \(.+?\)# matches "(abc) grrr (xyz)#", not the expected "(xyz)#".