In this part of our series exploring Perl RegEx we are going to look
into another advanced construct, that of the pattern code expression ??{code}. According to the official perldoc this "..is
like a regular code expression, except that the result of the code
evaluation is treated as a regular expression and matched immediately."
We will also attempt to combine it with the ?{code} code evaluation expression, covered in the first part of the series.
We'll build on the same scenario, in which we were receiving a serialized stream from a web service that had all special characters encoded in HTML entity hex encoding. The requirement was to convert them back to their actual character representation, for example '£' would become the pound £ symbol). Additionally we are going to search for files that contain the decoded string in their names.
read full article on i-programmer
We will also attempt to combine it with the ?{code} code evaluation expression, covered in the first part of the series.
We'll build on the same scenario, in which we were receiving a serialized stream from a web service that had all special characters encoded in HTML entity hex encoding. The requirement was to convert them back to their actual character representation, for example '£' would become the pound £ symbol). Additionally we are going to search for files that contain the decoded string in their names.
read full article on i-programmer
Comments