Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    san jose, CA

    Unanswered: how to use regular expression to escape symbols?

    hello everyone:

    I want to read data from a CSV file and import the data into database table.
    the data may contain pound sign, underscore and forward slash.

    sample data from the CSV file: EC316UA#AGS, QV2K4-4E58Q-36GFA-QB86J, N/A

    a) shall I search these symbols one at a time (escape them one at a time) or
    I can search all three symbols at once and escape the them at the same time?

    I am thinking use ereg_replace() to match the symbols, escape them and insert the data
    into table.

    Please give me some advises on how to accomplish this, I appreciate your help!

  2. #2
    Join Date
    Mar 2007
    Why are you escaping them? Escaping a #, -, or / has no benefits from what I can see. Escape your output, NOT your input. Filter your input...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts