GREP to find the end of the name of the author of history (problems with several lines)

Screen shot 2010-08-10 at 11.11.37 AM.png

I don't get these documents and I can understand how to use GREP to search for each source name/quote author. I have problems with the above example. I think it's because of paragraph returns, possibly something to do with the comma. I've fiddled around for an hour, tent multi and expressions of the one line and still can not understand.

It's what works for the most part:

(? < = \r)\s*[–][-\u\l]+(?=\Z)

Screen shot 2010-08-10 at 11.32.42 AM.png

If you can count on having the line beginning with an en dash (possibly after an unused space), this should do it:

^\s*~=.+\Z

The ^ indicates start of a line, while (?)<=\r) relies="" on="" a="" hard="" return:="" ^="" will="" also="" match="" start="" of="" story,="" and="" all="" sorts="" of="" hard="" page/column="">

Do not "anticipate" \Z; Since it is also an indicator of the place, like ^ and $, there can never be "selected" in the traditional sense of the term. (Which is the reason why allowing you a \r postanalyse, because * will * be selected if not).

Your example of Homer Simpson was rejected because of the hard return and the comma - or were in your list of approved characters.

I think opt for the period more ('get all') should work, but it is not - by default - search returns. This is where the modifier of Single-Line can help you. A brief description of the single-line Mode is that it allows the period correspond to a return as well. the history is considered one long line, with possibly a few \r codes that are not treated as special programs.

It will work for GREP search only:

( ? s)^\s*~=.+\Z

but not for the GREP styles. A GREP style still works only for a single paragraph; You can have a \r code anywhere in the expression. Oddly enough, TI work if you draw a soft line break in this last line - the strange thing is, the style GREP also needs (? s), so, apparently, at this level the soft line break is also considered a line break.
Furthermore, your example of Homer Simpson has an additional line below, and causing trouble because there is no \Z just after what you want to find. Allowing returns will add that last line in your search, which may not be what you want either. Replace the hard return by a soft will also solve part.

Tags: InDesign

Similar Questions

Maybe you are looking for

  • Satellite Pro U400-18 s faulty motherboard

    My friend Satellite Pro U400-18 s will not start.Pass the initial Toshiba screen, I had to check it out for the PC tech guy, and they could not get pass this screen as well. However, they confirmed that the hard drive has been authorized. They sugges

  • Repair VI.lib

    Is it possible to fix the vi.lib? I noticed that there are several dependencies in my project that came from other independent projects in one of my projects. Then, I started to find the number of callers to this VI.  He ends by that somehow some of

  • HP Quickweb is necessary?

    I have a HP Pavilion dmz1 which runs on Windows 7.  It is a couple of years now, but still works great in all. Recently, I stop the laptop and put it aside for two weeks.  When I booted the machine today, I was surprised to see an outdoor screen.  In

  • Cannot delete file

    I'm unable to delete a file, the message is "...". Treaty to location that is unavailable. How can I force delete it?

  • HP-G053NL: HP-G053NL Ram and hard drive replacement

    Hello There's a guide for hard drive replacement/upgrade and RAM laptop HP-G053NL? Thank you.