Do you get something different when you run it? Or do you want something different from that?extracted foo, bar, baz; left ...blah......blah...
When you try to use the "s{...}{}" expression in your own code, is it possible that your "raw binary data" (in "the baz part") might contain a byte value of 0x3C? This would be treated as a "<" character in the regex match, which would cause trouble. Something like this might work better in that case:
(update: added the "s" modifier at the end, in case the raw binary stuff might contain a line-feed)s{<file fiop="([^"]+)" length="([^"]+)"/>(.*?)</file>}{}s
Note the question mark after ".*" -- that's the important thing that was missing from your initial attempt: it makes the wildcard match non-greedy (stops matching as soon as possible).
In reply to Re^3: extracting a substring from a string - multiple variables
by graff
in thread extracting a substring from a string - multiple variables
by walinsky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |