Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Regex Expressions not working on Android/iOS


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Aug 21, 2017 8:22 AM Last Post By: Joe Fermani Threads: [ Previous | Next ]
Joe Fermani

Posts: 10
Registered: 2/4/13
Regex Expressions not working on Android/iOS  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 18, 2017 10:02 AM
I have an app which uses a RegEx expression to convert text without spaces and make it readable. For Example, it will convert the string IAmOneSentence into I Am One Sentence. The regex expressions is as follows:
var
    Exp: TRegEx;
    value: string;
 
begin
    Exp.Create('(?<=[a-z])(?<x>[A-Z])');
    value := Exp.Replace(TheString, ' ${x}');
    return value;
end;


This code has worked perfectly for me in Delphi Seattle. I run the app in Windows, iOS, and Android.
I upgraded to Delphi Tokyo 10.2 Update 1 and now this code no longer works for iOS/Android.

In iOS/Android I get the following:

Input: GreaterThan Output: GreaterT

If I try my app under Windows I get "Greater Than" which is correct.

Any ideas as to why this stopped working?

Thanks

Edited by: Joe Fermani on Aug 18, 2017 10:02 AM
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Regex Expressions not working on Android/iOS [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 18, 2017 1:40 PM   in response to: Joe Fermani in response to: Joe Fermani
Am 18.08.2017 um 19:03 schrieb Joe Fermani:
I have an app which uses a RegEx expression to convert text without spaces and make it readable. For Example, it will convert the string IAmOneSentence into I Am One Sentence. The regex expressions is as follows:
var
    Exp: TRegEx;
    value: string;
 
begin
    Exp.Create('(?<=[a-z])(?<x>[A-Z])');
    value := Exp.Replace(TheString, ' ${x}');
    return value;
end;


This code has worked perfectly for me in Delphi Seattle. I run the app in Windows, iOS, and Android.
I upgraded to Delphi Tokyo 10.2 Update 1 and now this code no longer works for iOS/Android.

In iOS/Android I get the following:

Input: GreaterThan Output: GreaterT

If I try my app under Windows I get "Greater Than" which is correct.

Any ideas as to why this stopped working?

Thanks

Hello,

did you already look in quality.embarcadero.com whether there is a
bugreport about this already?

Greetings

Markus
Joe Fermani

Posts: 10
Registered: 2/4/13
Re: Regex Expressions not working on Android/iOS [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 21, 2017 8:04 AM   in response to: Markus Humm in response to: Markus Humm
I checked Quality Central and found no bug report. In checking the code I found there is a new bug when Delphi attempts to manipulate the UTF8strings on the mobile platform. Insert and Delete functions are not working correctly with UTF8Strings on Android and iOS. It does work OK in Windows and the iOS simulator. The code for processing Regular Expressions had been updated to UTF8Strings which explains why I am having problems on my mobile apps.

I have submitted a bug report to Embarcadero so they can correct this. Bug Report #: RSP-18887

Edited by: Joe Fermani on Aug 21, 2017 8:20 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02