Here is sample text-
display_errors = On
display_errors= Off
display_errors = On
I would like to extract the value of last display_errors. How do I do that?
So far, I’ve display_errors =(?!.*display_errors = ) which is able to match display_errors = but I want its value, not the key.
I am using libpcre for matching with . matches all option
Please note I’ve to use regex and not any .ini parsing library.
Try the following:
That should match the last value for the
display_errorskey, assuming the values are charactersa-z(but the accepting-character list can easily be updated if needed).