I want to parse this json data with regex. But, i could not.
I tried like this module.getid(.*)
, but no working.
Only, I want to take this part -> mod
Well, to work from that new string you gave us:
module.getid([{"id":"44423", "code":"mod_editor"}]);
Here's a regular expression that nicely compartmentalizes all the data from the line provided
m/module\x2egetid\x28\x5b\x7b\x22(?
You can reference the fields by using the named captures or the number of the capture, whichever you prefer.
in this case to just return the portion of data which in this string is 44423 you could either reference capture number '2' or capture name 'value1'.
I'm not sure which language you're using to 'parse' this data, so I couldn't give you an actual snippet of working code.