Question: I have issue with parsing following json

```
"name.regex" : "/^\s*.{1,500}\s*$/"

```

i getting the following exception

```
Uncaught SyntaxError: Unexpected token ' in JSON at position 170

```

Answer: 
I hope this answer is not too late.

Minutes ago, I have emailed Remiz(this book's author), and got such a replay(extract some segments):

> 
> Without calling wait() is hard, and not really the main point.
> What you did -- learning about signals on your own -- is a good sign,
> showing you will seek out deeper knowledge. Good for you!
> 
> 
> 

> 
> Later, you'll be able to use a shared memory segment, and
> either condition variables or semaphores, to solve this problem.
> 
> 
>
I can't see why second question would imply that answer is "yes" to the first.

Yes there is plenty of solutions to obtain what asked, but of course I suspect that all are not in the "spirit" of the problem/question where the focus in on `fork/wait` primitives. The point is always to remember that you can't assume anything after a fork regarding the way processes ran relatively to each other.

To ensure the child process print first you need a kind of synchronization in between both processes, and there is a lot of system primitives that have a semantic of "communication" between processes (for example locks, semaphores, signals, etc). I doubt one of these is to be used her, as they are generally introduced slightly later in such a course.

Any other attempt only that will only rely on time assumption (like using `sleep` or loops to "slow" down the parent, etc) can lead to failure, means that you will not be able to prove that it will always succeed. Even if testing would probably show you that it seems correct, most of the runs you would try will not have the bad characteristics that lead to failure. Remember that except in realtime OSes, scheduling is almost an approximation of fair concurrency.

NOTE:

As Jonathan Leffler commented, I also suppose that using other `wait`-like primitives is forbidden (aka `wait4`, `waitpid`, etc) -- "spirit" argument.