[Solved] Regexmatch in PHP serialized data? - DonationCoder.com
Welcome Guest.   Make a donation to an author on the site May 27, 2015, 11:01:52 AM  *

Please login or register.
Or did you miss your validation email?

Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.

You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
The N.A.N.Y. Challenge 2014! Download dozens of custom programs!
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: [Solved] Regexmatch in PHP serialized data?  (Read 186 times)
Supporting Member
Posts: 93

View Profile Give some DonationCredits to this forum member
« on: May 08, 2015, 01:58:49 AM »


Edit: Solved, I wrote a function that parses all pairs...

for example I have the following string:
$a = 'a:1:{s:9:"@test.bat";a:1:{s:24:"AJXP_METADATA_SHAREDUSER";a:1:{s:10:"users_meta";a:1:{s:4:"tags";s:20:"batch file {new tag}";}}}}';

Is there an intelligent way (the used regex engine (Visual Basic (no .NET) is "mostly" pcre compatible. One exception: Positive & negative lookbehinds aren't supported) to get the content of the innermost {} pair that is NOT inside quotation marks?

In this case I'd like to match exactly this part:
{s:4:"tags";s:20:"batch file {new tag}";}

The real innermost pair of {} would be:
{new tag}
but this is inside a double quoting
"batch file {new tag}"
and therefore shouldn't be treated as the innermost {}...
« Last Edit: May 08, 2015, 03:36:06 AM by highend01 » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.036s | Server load: 0.23 ]

Share on Facebook
submit to reddit