Regular expression - stop at first match

Posted by publicRavi on Stack Overflow See other posts from Stack Overflow or by publicRavi
Published on 2010-03-23T20:36:35Z Indexed on 2010/03/23 20:43 UTC
Read the original article Hit count: 120

Filed under:

My pattern looks something like

<xxxx location="file path/level1/level2" xxxx some="xxx">

I am only interested in the part in quotes assigned to location. Shouldn't it be as easy as below without the greedy switch? Does not seem to work :(

/.*location="(.*)".*/

© Stack Overflow or respective owner

Related posts about regex