On Feb 21, 2006, at 2:58 PM, Haris wrote:
Oliver: One thing you could try, if these things are hierarchical, is to have a begin pattern for the first line, and ending in something hopefully meaningful.
Here's what i managed to come up with:
begin = '^[A-Z]{2,10}.*[A-Z]*(\s*|()$'; end = '.$|?$|!$|--$|-$';
...which suits my needs *okay* but not perfectly. ---------- I'm using the following (adapted from Dr. Drang's suggestion):
^([A-Z]+.*[A-Z]*\s*)\n((.+))\n(.+)$
for a search and replace string like this one:
s/^([A-Z]+.*[A-Z]*\s*)\n((.+))\n(.+)$/\n\n\t{4}$1\n\t{3}$2\n{2}$3/;
...which makes sense to me, but it doesn't insert those tabs or newlines when piped thru a command. Clearly I'm missing something here. As you can no-doubt tell, I'm a complete noob when it comes to all this programing.
As an example, this: ----------------- OLIVER (I want to tell you) I've got things to say. Dr. Robert ----------------- should look like this: ---------------------------
OLIVER (I want to tell you) I've got things to say.
Dr. Robert ---------------------------
If I may suggest, it would be helpful if you add a test screenplay in the bundle, so that anyone in the future working on it knows how it looks like and what not to break. Like the test.tex we have in the LaTeX bundle.
I'll do that.
On Feb 21, 2006, at 5:23 PM, Oliver Taylor wrote:
I'm using the following (adapted from Dr. Drang's suggestion):
^([A-Z]+.*[A-Z]*\s*)\n((.+))\n(.+)$
for a search and replace string like this one:
s/^([A-Z]+.*[A-Z]*\s*)\n((.+))\n(.+)$/\n\n\t{4}$1\n\t{3}$2\n{2}$3/;
...which makes sense to me, but it doesn't insert those tabs or newlines when piped thru a command. Clearly I'm missing something here. As you can no-doubt tell, I'm a complete noob when it comes to all this programing.
I guess i misunderstood you, I thought you just wanted to change the language grammar, not do search and replace stuff. This should work all right, though I am not sure what you mean by "piped thru a command", I thought you were just doing a search and replace. In that case, using \t\t\t\t instead of \t{4} should do the trick. The \t{4} only has a meaning in the regexp to be matched, not in the expression to replace it. .
As an example, this:
OLIVER (I want to tell you) I've got things to say. Dr. Robert
should look like this:
OLIVER (I want to tell you) I've got things to say.
Dr. Robert
What do you get when you use the above? How are you using the above? Are you simply doing find&replace with regexp on?
Haris