Regex to find uppercase texts


#1

Hi, I have a kung fu course facebook page (https://www.facebook.com/6dragonskungfustyle) and I have exported the 2015’s posts.

These posts have lost their formatting and I have texts like this:

“TITLE OF THE POST Start of the post text. Hello, goodbye.”

I need a working regex to put a separator ("§") after the title of the post… something like this:

“TITLE OF THE POST§Start of the post text. Hello, goodbye.”

How can I do?
Thanks to all will reply to me!


#2

What tools do you use? what languages? How and where is the data? Do you need to extract it from facebook? Did you export it into a file, if so, what kind of file?


#3

Imagine that I have only that text, I can use javascript or any other kind of regex environment, even an online tool. If for you is more simple we can use this:

https://regexr.com/


#4

But i will need a sample of the text, given i can’t just construct a regex based on guess work


#5

The texts are all the same, they have the same format: “TITLE OF THE POST Start of the post text. Hello, goodbye.”


#6

but are they on a single line? Multiple lines?

why can’t you just give me a sample? remove the sensitive data if you have to, but ensure the structure stays intact

you want my help or not?


#7

Single line, this text describes them perfectly. There is nothing else.


#8

well, here is a good start:

([A-Z]*[A-Z][ ]+)

the only problem this represents, is if your the title post contains a word of a single letter. This will always be a problem, given Start of post text also starts with a uppercase letter

can you understand that from the helping point of view, its frustrating to keep having to ask for information?

This page also suggests some helpful commands:

https://www.mobileread.com/forums/showthread.php?t=164568


#9

Thank you the problem is solved


#10