code_junkie

Is it safe to read regular expressions from a file?

Nov 11th, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. (?{code})
  2. (??{code})
  3. ${code}
  4. @{code}
  5.  
  6. eval {
  7. qr/$re/;
  8. };
  9. if ( $@ ) {
  10. # do something
  11. }
  12.  
  13. (?: ( ?{1,2} { # '(' followed by '?' or '??', and then '{'
  14. | @ { s* [ # a dereference of a literal array, which may be arbitrary code.
  15. )
  16.  
  17. (?{ code })
Add Comment
Please, Sign In to add comment