help with a find and replace syntax

I have a DT database filled with Supreme Court opinions downloaded from Lexis. By default, these files (RTF) have codes embedded in them for Lexis Headnotes, and page numbers.

For example, there are tags that look like this:

There would then be [***LEdHR2] [2] and occasionally [***LEdHR3A] [3A]

And page numbers like [*2] [**245] [***27]

I need to find a way to strip the file of them, but after looking at the wild-cards in the Search Help, I can’t seem to get any wildcards to work. Once these are gone, I can use DT’s great word count features to measure opinion length, which is a dependent variable in some of my research.

Is it possible to use DT to Find/Replace with some sort of wildcards to get rid of this?

I would really appreciate some help here, as the documentation on wildcards says very little, and nothing seems to work, with even the simplest search! Anybody out there???

Either I am misunderstanding what you want to do or you are misunderstanding what the software will do.

The searchField at the upper right is for document location, not modification.

If you have a file with the specific item you are looking for, the Find dialog (Command-F) does not support wildcards. This is a standard Apple provided Find and Replace dialog.

Since you want to modify file contents you would really be looking at a scripted solution.

Well, I guess that is poorly identified in the documentation. And yes, I was trying to use the Find and Replace. And was assuming it supported wildcards, which are described in help for search operators.

I still would argue that the description of those search operators could be much improved, in terms of providing actual examples with wildcards.

DEVONthink searches can use wildcard characters, * or ?. But you cannot search for those characters. Only alphanumeric characters are recognized. Information about the operators and syntax of DEVONthink searches is available under Help, and as an appendix in the PDF user documentation.

The Find procedure, invoked by Command-F, is NOT a DEVONthink procedure but is a standard Apple procedure. It does not use wildcards. Find and replace for non-alphanumeric characters is permitted.

Back to the OP’s questions - let’s try to find a way to solve the problem.

What you do next depends on what “filled” means – I assume it means “more than I want to handle one-by-one”

RTF is going to be difficult to deal with - if you can convert these to plain text, the following suggestions will be easier (or possible).

As you’ve read, DEVONthink won’t do this for you. IMO, what you are looking to do is a specialized task that not many editors can perform, but, a quality text editor that can do search and replace based on regular expressions will do the job – and do it for a batch of documents or automate the process with a macro or similar procedure. Notice “text editor” – meaning, plain text. Regular expression find/replace is possible in some Rich Text editors (e.g., Nisus Writer Pro), but is more common in plain text editors. My personal choice for the task is BBEdit, for its “text factory” feature which can do complex regular-expression-based changes to sets of documents. (The free TextWrangler product from the same supplier formerly supported text factories, but no longer does.) Another option is Sublime Text. Neither BBEedit nor Sublime Text are rich text editors – so conversion to plain text would be necessary. (You can convert all of your rich text documents to plain text rapidly with DEVONthink.)

A third approach (which does not involve a suggested conversion of your files to plain text) would be to use a utility such as CleanHaven Pro. These are not editors, but will take text from the clipboard and apply various rules, including regular expressions, to “clean” the text.

A final approach, suggested by Jim, is to script a solution. You might find some existing scripts on the net that will do regular expression search and replace, or build one yourself. It’s a lot of work for a one-time task.

If I were doing this, I’d get the BBedit trial.