cancel
Showing results for 
Search instead for 
Did you mean: 

Regex - What's going on?

Any help would be greatly appreciated.

 

I'm using the Filter tool, and cleaning up address data where the address sometimes is adjacent to the city without any space or delimiter.

 

The following statement works great:

 

REGEX_Replace("P.O. Box 711 Real Estate Unit 123Dallas TX 75201", "(\d)(\u)", "$1 $2")

Result: P.O. Box 711 Real Estate Unit 123 Dallas TX 75201

 

However, this one does not:

REGEX_Replace("P.O. Box 711 Real Estate DepartmentDallas TX, 75201", "(\l)(\u)", "$1 $2")

Result: P.O. B ox 711 R ea l E st at e D ep ar tm en tD al la s TX, 75201

 

I've tried several variations to no avail, including:

REGEX_Replace("P.O. Box 711 Real Estate DepartmentDallas TX 75201", "([a-z])([A-Z])", "$1 $2")

 

Any help in creating a regex statement inserting a space between a lowercase letter directly adjacent to an uppercase letter would be absolutely wonderful.

 

Thanks!

 

Try adding a ,0 to the end of your regex function. By default, it is case insensitive, even if you use something like \u. There is an optional forth parameter that you can set to 0 (case sensitive) or 1(case insensitive=default).

We can investigate further if that doesn't do the trick.

That worked. Thanks!