Question: How would you search through an entire string and display each item found in a div?

The thing I'm searching for is a license code which starts with NVOS and ends with ". I'd like to extract the entire code except for the "

The thing I want to parse would be like NVOS-ABCD-EFG-HIJK-LM52P" but I don't want the " included.

Here is what I'm trying:

```
var myRe = /^NVOS[^"]*/g;
var myArray = myRe.exec(document.getElementById("txt").value);
console.log(myArray)
for (i in myArray){
console.log(i)
}

```

Not working.

Answer: 
There must be a limit on the size of queues. Consider the following modification:

```
from multiprocessing import Process, Queue

def foo(qin,qout):
    while True:
        bar = qin.get()
        if bar is None:
            break
        #qout.put({'bar':bar})

if __name__=='__main__':
    import sys

    qin=Queue()
    qout=Queue()   ## POSITION 1
    for i in range(100):
        #qout=Queue()   ## POSITION 2
        worker=Process(target=foo,args=(qin,))
        worker.start()
        for j in range(1000):
            x=i*100+j
            print x
            sys.stdout.flush()
            qin.put(x**2)

        qin.put(None)
        worker.join()

    print 'Done!'

```

This works as-is (with `qout.put` line commented out). If you try to save all 100000 results, then `qout` becomes too large: if I uncomment out the `qout.put({'bar':bar})` in `foo`, and leave the definition of `qout` in POSITION 1, the code hangs. If, however, I move `qout` definition to POSITION 2, then the script finishes.

So in short, you have to be careful that neither `qin` nor `qout` becomes too large. (See also: [Multiprocessing Queue maxsize limit is 32767](https://stackoverflow.com/questions/5900985/multiprocessing-queue-maxsize-limit-is-32767))
I was trying to `.get()` an async worker after the pool had closed

indentation error outside of a with block

**i had this**

```
with multiprocessing.Pool() as pool:
    async_results = list()
    for job in jobs:
        async_results.append(
            pool.apply_async(
                _worker_func,
                (job,),
            )
        )
# wrong
for async_result in async_results:
    yield async_result.get()

```

**i needed this**

```
with multiprocessing.Pool() as pool:
    async_results = list()
    for job in jobs:
        async_results.append(
            pool.apply_async(
                _worker_func,
                (job,),
            )
        )
    # right
    for async_result in async_results:
        yield async_result.get()

```