Jump to content

Auto-BackSlash preg_match() Op Chars


D3xt3r

Recommended Posts

Here is my issue.

 

I am the developer of XDD (Xegment Delta Databasing), FlatFile databasing system.

 

But I need a easy way to do something.. When searching through a FlatFile database, the system uses preg_match for each line to detect matches. I need to find a way to auto-backslash any operator characters that PHP may not read as standard text.. So a user can search any term, such as "02/05/2008" or alike. Now, I could go down a huge str_replace line and replace each character, but I want a easier way to do this...

 

If all else fails, I could just get a script to backslash every character in the user defined string. That would work as well, since PHP doesn't care if you backslash unneededly.

 

Any idea?

Link to comment
https://forums.phpfreaks.com/topic/110380-auto-backslash-preg_match-op-chars/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.