At the end my test script (similar to the scripts that you guys made ;-)
delivered the correct output:

Used the following regex: ^(\d+)\s+-\s+(\S+@\S+).*
and enabled the dot all mode in the option tab

So, the input data contained a line terminator (grmbl)
Still wondering why I must match the full line. When I remove the .* it
just return null values...

Anyway, Thankx for the support!

/ Wim.


On Mon, Jun 12, 2023 at 3:42 PM Wim Peggeman <[email protected]> wrote:

> I struggle with the regex functionality in Apache Hop
>
> I have the following test string:
> 31636156922 - [email protected] - (Profile: Device Admin) - (Apple
> iPhone SE EF 64 GB)
> I want to retrieve the first 2 items. The (telephone)number and the email
> address
>
> I am using the following regex:
> ^(\d+)\s+-\s+(\S+@\S+)
>
> I used https://regex101.com/ to validate the regex. Selected the java8
> mode. The regex works. However, I get no matches when I try this in the
> regex evaluation component in apache hop.
>
> Even when I expand the regex to ^(\d+)\s+-\s+(\S+@\S+).* the regex does
> not work.
>
> This is not the first time I run into the regex mismatch. In most cases I
> solve it with trial and error by rewriting the regex. I am curious how
> other hop users create and test regex functions.
>
> My Setup:
> - Apache Hop 2.4.0 (2023-03-27 07.51.24),
> - Microsoft Windows 10 Enterprise (Version 10.0.19044 Build 19044)
> - OpenJDK Runtime Environment Corretto-17.0.5.8.1 (build 17.0.5+8-LTS)
>
>

Reply via email to