My regex is matching too much. How do I make it stop? -


j0000000: transaction a0001401 started on 8/22/2008 9:49:29  j0000010: project name: e:\foo.pf  j0000011: job name: mbiek direct mail test  j0000100: machine name: dev  j0000100: project file: e:\mbiek\foo.pf  j0000100: template file: e:\mbiek\foot.xdt  j0000100: job name: mbiek  j0000100: output folder: e:\foo\a0001401  j0000100: temp folder: e:\foo\output\a0001401  j0000100: document 1 - starting document  j0005000: document 1 - text overflowed on page 1 (warning)  j0000101: document 1 - 1 page(s) composed  j0000102: document 1 - 1 page(s) rendered @ 500 x 647 pixels  j0000100: document 1 - completed  j0000020: 

i have gigantic ugly string , i'm tring extract pieces using regex.

in case, want grab after "project name" part says "j0000011:" (the 11 going different number every time).

here's regex i've been playing with

project name:\s+(.*)\s+j[0-9]{7}: 

the problem doesn't stop until hits j0000020: @ end.

how make regex stop @ first ocurrence of j[0-9]{7}?

make .* non-greedy adding '?' after it:

project name:\s+(.*?)\s+j[0-9]{7}: 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -