###Initial String ["1", '123', "0.5", "10.5", "10.50", " 1 ", "1,000", ".5", "5.", "1.0.0", 1, "Windows 98"] ###Desired String [1, 123, 0.5, 10.5, 10.50, 1, "1,000", ".5", "5.", "1.0.0", 1, "Windows 98"] ###Goal: "Remove quotes surrounding valid integers or floats" ####Find Pattern ["'] *(\d+(.\d+)?) *["']
["']finds beginning of string (either"or').[]wraps character class
- You can drop the
[]wrapper and simplify to"or'if all your strings are quoted the same way.