in reply to Parsing a line from a line with one line of perl code.
In Perl you doignore until you find [ read in buffer until you find [ or ] if you found ] the buffer is your result if you found [ reset buffer {optional - if you reach the end and there's no ], scream "betrayal!"}
Match anything between [ and ], unless you find a [, otherwise you'd pick up anything between the first [ and the first ].$input = ...your text here...; $result = /.*\[(.*^[)\].*/;
Hope this helps!
|
|---|