Hi,
I have spent a good 3 days to find out a way to do this and started to have a headache. lol
I want to add space before capital letters using a Perl regex or JavaScript. (I prefer Perl.)
For example, AbcdeFghiJklmnoPqrstuvwXyz ---> Abcde Fghi Jklmno Pqrstuvw Xyz.
How can I do this?
Also, how can I select a portion of the string starting with a capital letter, not ending with a capital letter.
For instance, how can I select Abcde in the string?
[:upper:].+(?![:upper:]) , [A-Z].+(?![A-Z]) and [\p{Lu}].+(?!\p{Lu}) didn't work.
I am just wondering why the 3 regular expressions above don't work.
I also tried adding the non-greedy operator ? at the end of the 3 regular expressions above.
I think I can do something if I can select any portion of the string starting with a capital letter, not ending with a capital letter.
Thank you very much.
I have spent a good 3 days to find out a way to do this and started to have a headache. lol
I want to add space before capital letters using a Perl regex or JavaScript. (I prefer Perl.)
For example, AbcdeFghiJklmnoPqrstuvwXyz ---> Abcde Fghi Jklmno Pqrstuvw Xyz.
How can I do this?
Also, how can I select a portion of the string starting with a capital letter, not ending with a capital letter.
For instance, how can I select Abcde in the string?
[:upper:].+(?![:upper:]) , [A-Z].+(?![A-Z]) and [\p{Lu}].+(?!\p{Lu}) didn't work.
I am just wondering why the 3 regular expressions above don't work.
I also tried adding the non-greedy operator ? at the end of the 3 regular expressions above.
I think I can do something if I can select any portion of the string starting with a capital letter, not ending with a capital letter.
Thank you very much.