[RegEx] Replace characters

B

Bouba654

HEllo,

I would like to write a regex for mod_rewrite in order to replace all "?" by "!".
Do you think it's possible ?

Thanks,
AT/
 
G

Gunnar Hjalmarsson

Bouba654 said:
I would like to write a regex for mod_rewrite in order to replace
all "?" by "!".
Do you think it's possible ?

Probably.

This is a Perl group. Why don't you ask in an Apache group?
 
H

Helgi Briem

I would like to write a regex for mod_rewrite in order to
replace all "?" by "!".
Do you think it's possible ?

If regexes in apache are anything like those in Perl,
it might be something like:

s/\?/!/g;
 
J

Jürgen Exner

Bouba654 said:
I would like to write a regex for mod_rewrite in order to replace all
"?" by "!". Do you think it's possible ?

No idea what mod_rewrite is, but why do you want to use a regexp? The
question mark is a single character that you already know, no need to launch
the big RE shotgun. A simple
tr /?/!/
is sufficient and will be significantly faster, too.

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top