17
Views
1
Comments
Solved
[Reactive Utilities] Does Regex_* support Positive and Negative Lookahead?
mobile-utilities
Reactive icon
Forge component by Miguel Vicente
Application Type
Reactive

I attemped to use Regex_Replace to replace the following regexes.

Sample Source String: "Name=Value; Path=/; Secure; HttpOnly; SameSite=None; Secure,Name2=Value2; Path=/; Secure; HttpOnly; SameSite=None; Secure"

Regex1: "(?!((^|,)[^=]+=[^;]+;))\s[^=,]+(=[^;]+;|(;|,|$))"

Regex2: ",(?=([^;]+(?==)))"

However, it does not seem to work. The result string remains unchanged. It works with the Server action Regex_Replace in Text Module. But I wanted a use a client action. 

Thank you. 

DK

Solution

The Regex functions in Reactive Utilities likely do not support advanced regex features like Positive and Negative Lookahead. The functionality exposed by the client-side actions in Reactive Utilities may be limited compared to the full capabilities of regex patterns supported by server-side actions. This is most likely due to the constraints of client-side JavaScript's regex engine versus what's available in server-side technologies.

If you find that you need advanced regex capabilities in a Reactive application, one workaround is to execute a Server Action that performs the regex manipulation you need. Although it introduces a server call, you'll be able to leverage the full power of regex functionalities available on the server side.

You may also consider using JavaScript directly for regex operations that aren't supported by Reactive Utilities. You can execute JavaScript code using the "RunJavaScript" action in OutSystems.

Best,

RAD Manage

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.