1 Reply Latest reply on May 19, 2014 7:32 AM by SJRiegel

    GREP select every character up to first space

    maguskrool Level 1

      Hi. I'm trying to format a reference list that contains several entries with urls (plain text, no interactivity) and I need those urls to be italic. I created a character style that I want to apply using GREP. In all the entries, the url is either the last thing on the paragraph, or it is followed by a space and then some text. All urls begin with http://. Here are some examples:

       

      SMITH, H. The Laws of Physics, 2000. http://www.abcde.com/myexample.pdf

      JONES, L. Just Another Title, 1996, General Editions - http://thisisit.com - last version checked: 3.1

       

      Right now I've gotten it almost right. I've used the following expression:

       

      http://.*(?= )

       

      This looks for "http://"m then any character any number of times, then a positive lookahed for a space. However, this applies the style to everything up to the last space, like this:

       

      JONES, L. Just Another Title, 1996, General Editions - http://thisisit.com - last version checked: 3.1

       

      Any ideas on how I get it to work just up to the first space? I've also tried looking for a way to search for any characters except spaces, but couldn't find it.

      Thank you.