Im quite new to stackoverflow so I dont know if this question has been asked before, but I cant seem to find any past questions which hint at the answer. Any help is really appreciated and thanks in advance.
I have this text:
{
1282837200, -- [1]
"Type", -- [2]
"Name", -- [3]
"Reason", -- [4]
Amount, -- [5]
}, -- [1]
{
1282838220, -- [1]
"Type", -- [2]
"Name", -- [3]
"Reason", -- [4]
Amount, -- [5]
}, -- [2]
Which I need to create a regular expression for and extract the necessary data. I understand how to extract data from source files using regular expressions within PHP, using source text which has no “whitespace” or carriage returns.
But I need help with creating an expression which includes the whitespace etc. included within this source.
\sis the symbol for whitespace, which may or may not include newlines, anyway there’s[\r\n]for them, ignore these and that’s it. You could also tell what exactly you want to do or even post the regex you have so far so I can help you further if you want.EDIT: I’m just guessing, the regexp you want may be this:
This matches one block and disregards the numbers in brackers.
/mswitch triggers multiline mode.