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 4:18

Subroutines have the expressive capabilities of a Turing-machine. It would no longer be a regular grammar if you could do that.

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