0

With regex I created a large list of PHP define from xml data list, here's an excerpt:

<?php
...
define("New Research ? (U)(GAI)",183);
define("Port, (GAI)",184);
define("Cathedral (U)(GAI)",185);
define("Civ: Indians (H)",186);
define("Bonus Heal +10% (A)",187);
define("Bombard Cannon (A)",188);
...
?>

So I have ~1000 defines like this, and as you see they are not valid. I need to replace all special caracters with "_" and uppercase letters.

I could use regex but it will be very laborious, there are too much cases to handle in this list, and I have to prevent getting double underscores like "__". More, I may do it again in future.

Do you have any idea of best way to fix this ? Is there an online tool to format any strings to correct alphanumeric format ?

Rizier123
  • 58,877
  • 16
  • 101
  • 156
sylvain1264
  • 855
  • 2
  • 8
  • 23

0 Answers0