Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

【Perl】Subroutines in regex?【Amateur】

Name: Anonymous 2011-04-17 3:58

Can I use subroutines in regex?

For example, is it possible to do something like:

$string =~ /<Text (example)>/<Text convert_text($1)>/g;


I know that doesn't work like that, but is there a way to do something like that?

Name: Anonymous 2011-04-17 5:24

>>2
It depends on what you mean by "subroutines". Regular expressions (or rather, finite state automatons) are capable of carrying out any computation which requires only constant amount of memory.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List