Mobile app version of vmapp.org
Login or Join
Jessie594

: What regex engine does mod_substitute use? Any idea what regex engine mod_substitute uses? I'd like to do a little search and replace with it, and I need to escape some characters, so I wanted

@Jessie594

Posted in: #Apache

Any idea what regex engine mod_substitute uses? I'd like to do a little search and replace with it, and I need to escape some characters, so I wanted to see how that particular engine handles that. (I'm guessing it's just to escape, but I wanted to know for sure.
httpd.apache.org/docs/2.4/mod/mod_substitute.html

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie594

1 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

As far as I know, Apache universally uses Perl Compatible Regular Expressions (PCRE). This is stated in the Apache glossary under Regular Expressions. mod_rewrite certainly uses PCRE (as stated in the mod_rewrite docs) and I would assume that mod_substitute does the same.

The backslash () escape is used in every regex version I've encountered.

Note that the Substitute directive uses delimiters to separate the different arguments (whereas mod_rewrite uses spaces). The default delimiter is the slash (/), but this can be changed to any other character if your string/regex contains the delimiter. Changing the delimiter is often preferable to escaping these characters in the string/regex.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme