First, let's establish that these are not part of an automatically formatted numbered list using the bullets and numbering options in the paragraph style (though they probably should be).
If you don't want to make them part of a numbered list, you should be able to find (^\t)(\d+)(\t) and change to $2[space character of your choice]
That said, I would make them the list and define it in a paragraph style, then find ^\s+\d+\s+ and replce with nothing, but change the change format to the correct paragraph style where the numbers and the spacer are defined. The advantage to this is that you can then rearrange, add or delete paragraphs in the list and the numbering will update automatically.
Thanks Peter! I appreciate your prompt feedback. I am very much a novice with InDesign, and so I'm not entirely sure how to do what you're saying as far as making the paragraphs part of a list. I know how to do that in HTML very well, and what I am doing is taking an existing InDesign document from a print publication my employer has produced and converting it to an e-book. As such, I am not adding or deleting any paragraphs. I'm simply marking this up so that I can export XML that will produce good .epub and .mobi files. I happen to know from experience that tabs translate as tabular data and I'll end up with a table or something like that and will then have to fix it in my HTML files. This is doable, but Adobe InDesign has a MUCH more powerful search function than my HTML editor, so I'd rather hammer it out in InDesign first.
I will try your suggestion of (^\t)(\d)(\t) changed to $2[ ]. Thank you for the input. Very helpful answer!
1 person found this helpful
Just so you understand, [space character of your choice] is just my way of saying put something in this spot after the $2 (without the ) to use as a separator. It can be a regular space, a fixed width space, or a tab (but you'll want to set the tab in the paragraph style) so the text always starts at the same position. You could even set a left indent equal to the tab position, and a negative first line indent if you need the numbers to hang to the left of the paragraphs when there is more than one line.
Just to affirm your assistance, this worked for me. I still don't understand the advanced search features perfectly, but I got the formatting fixed without having to sift through it manually. I found that replacing with "$2. " (minus the quotes) worked well. However, I noticed that searching for (\d). would turn up a digit followed by ANY kind of punctuation, not just a period. I assume therefore that . must mean something different in GREP than I'm thinking it does. I just wanted to find any digit before a full-stop. At any rate, that is something I can find a table of GREP search terms for. I didn't understand the $2 thing until I monkeyed with it. I'm typing now for future generations of newbies that might stumble upon my post. The $2 ignores the second character in your "Find what" field. So for example, if instead you had two tabs then a digit then a tab, you could search:
Find what: (^\t)(\t)(\d)(\t)
Change to: $3.
This would take any occurrence of two tabs, a number, and a tab and replace with a period, ignoring and therefore not changing at all the number. The $3 is saying "ignore the third search term", in this case, the \d.
A better approach would be to use +. This means "any time you see one or more occurrences of the searched-for character". This would look something like:
Find what: (^\t+)(\d+)(\t+)
Change to: $2.
Here you are saying "Any time you see one or more tabs followed by one or more numbers and then followed by one or more tabs, ignore the digit, delete the tabs before and after, and add a full stop after the number. This is a very powerful search feature, once you understand what you're doing anyway. Hope that is helpful to someone at some point.
Sorry, my fault entirely. I left out the period in the search query.
The correct query is (^\t+)(\d+\.)(\t+) if you are looking for "one or more" tabs on either side. The . in GREP is a wildcard for any character when used outside a class, so it would need to be "escaped" as \. .
If you don't know what the whitespace situation is, you can use (^\s+)([\d.]+)(\s+) which will find all whitespaces, not just tabs. The [\d.] class is any digit and the period (inside the class it's literal), and it would find any combination of digits and periods, like 1.2.33 in case your numbering runs that way.