0

I have a array in php, a lot of exif data, and I managed to print the data in a foreach loop.

But it shows the data like this:

  • FileName
  • ISO
  • InternalNDFilter

and I want to create spaces like in the code example below.

I am new to regex, I try to understand it, but it's a challenge for me :-)

So I only want to create a space before the uppercase letter IF the next letter is a lowercase, and I don't want a space if the first letter is a uppercase so FileName should be "File Name" and not " File Name" (no space at the beginning)

FileName
//should be File Name

ISO
//Should not change

InternalNDFilter
// Should be Internal ND Filter

I'm not sure if the example of the InternalNDFilter is possible, if that's not possible then it's no problem, the most important part are the examples of the first two (FileName, ISO).

I tried this and this one comes close : regeditor

Ralph Schipper
  • 701
  • 2
  • 12
  • 24
  • 1
    It probably can be reworked to something shorter, but to start of with, maybe try [this](https://regex101.com/r/Dp95YL/2) – JvdV Jun 02 '20 at 18:12
  • @JvdV Yes, that's exactly what I need thank you so much! I gave you a upvote, but how do I mark this as the correct answer? – Ralph Schipper Jun 02 '20 at 18:43
  • Your question has been marked as a duplicate so there is no place for answers here nomore. Glad your issue has been solved though. =) – JvdV Jun 02 '20 at 18:47

0 Answers0