Extract substring with RegEx  SOLVED

User-to-User discussion about the PhraseExpress macro programming.
Post Reply
SniperFodder
Posts: 4
Joined: 15 Apr 19, 20:09

Extract substring with RegEx

Post by SniperFodder » 09 Jul 20, 01:19

Hello,

I'm unable to find in the manual how to use Extract substring with RegEx. I have a form input asking for an email, and then I'm trying to process the output with a regex to only grab the first half of the email (Everything before the @). I'm using ^(.+)@.+$

https://i.imgur.com/iKQTRc1.png

When it outputs I get the full email address still.

Additionally, I can't search the forums.
https://i.imgur.com/sj1twop.png

low
Posts: 44
Joined: 21 Jul 15, 07:37

Post by low » 09 Jul 20, 10:32

Hi SniperFodder,

try
.*(?=@)
it´s a 'positive lookahead'.

Here you can find good explanations and a perfect playground for testing: https://regex101.com/

SniperFodder
Posts: 4
Joined: 15 Apr 19, 20:09

Post by SniperFodder » 09 Jul 20, 20:05

Hi,

I've always wondered what positive lookahead is used for. That clears that up.

Also I recently noticed that your accept button does not work for the downloads. It disables the buttons.

https://i.imgur.com/KyduSEx.png

Post Reply