Announcement

Collapse
No announcement yet.

EspoCRM RegEX type

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • item
    commented on 's reply
    No, the link to php site is just for see sample output, you can do with formula :

    $matches = string\matchAll(......);



    $i = 0;

    while(
    $i < array\length($matches),
    (
    HERE print $matches[$i];
    );
    $i = $i + 1;
    )
    );

  • esforim
    commented on 's reply
    Thank item, but this mean I need to do code?

  • item
    replied
    Hi,


    see sample : https://www.php.net/manual/en/functi...-match-all.php

    to try :
    $matches = string\matchAll(......);

    $matches is a array, so in formula script : you need use equivalent foreach
    while (length ....). see sample in forum or doc

    Leave a comment:


  • ThomasB
    replied
    Ok, I see. Didn't check the docs because for string/test I dont need them.

    I tried your exanple and it looks like it does not like: (?=.*\Buyer\b)

    Seem it does not like two ?=.

    Leave a comment:


  • esforim
    commented on 's reply
    You have to have '/ /' start and end for EspoCRM to work. It mandatory in EspoCRM else you get error.

  • ThomasB
    replied
    Try without the / and the start and end. Just like I wrote it: (Individual:\s*(.*?)\s(.*?)(?=\n|$)(?=.*\Buyer\b))
    Last edited by ThomasB; 07-18-2023, 09:39 AM.

    Leave a comment:


  • esforim
    replied
    Originally posted by ThomasB View Post
    Ok, have to tried to enter the RegEx like this?: (Individual:\s*(.*?)\s(.*?)(?=\n|$)(?=.*\Buyer\b))
    Thank you ThomasB, it work good with RegEX101 but doesn't with EspoCRM

    Click image for larger version  Name:	image.png Views:	0 Size:	109.7 KB ID:	95499

    Click image for larger version  Name:	image.png Views:	0 Size:	10.8 KB ID:	95500
    Click image for larger version

Name:	image.png
Views:	229
Size:	10.9 KB
ID:	95501

    Leave a comment:


  • ThomasB
    replied
    Ok, have to tried to enter the RegEx like this?: (Individual:\s*(.*?)\s(.*?)(?=\n|$)(?=.*\Buyer\b))

    Leave a comment:


  • esforim
    commented on 's reply
    Thank Thomas, for simpler RegEX it work no problem. Just with this RegEX I want it to stop before the word "Buyer" which is where I'm having the issue and need to find the right setting to see if it a EspoCRM thing or my RegEX string

  • ThomasB
    replied
    Well, not sure if it helps, but I had also an issue with RegEx and an IfThenElse switch.

    I used string\test

    E. g. I want to test if the input is either the a or b.

    The result of a check of a | b was different from (a | b)

    The first one always returns false even if a or b is set. The second one returned true if either a or b was set.
    So maybe try to put brackets around your whole term.


    Leave a comment:


  • esforim
    replied
    Giving this a bump, no one know? Or is the setting correct and it just EspoCRM don't full support PCRE2?

    Leave a comment:


  • esforim
    started a topic EspoCRM RegEX type

    EspoCRM RegEX type

    Anyone know what Regular Expression type does EspoCRM use?

    I use regex101.com to test and some regex work and some doesn't. It obviously I'm using the wrong setting so it to be expected.

    For example:

    Using this regex in RegEx101 work fine, but if I use it in EspoCRM I don't get a match. Need to know which setting I should be using to be compatible with EspoCRM. Thank you.

    Website: https://regex101.com/
    Link to example: https://regex101.com/r/vctwJB/1

    Screenshot of it:
    Click image for larger version

Name:	image.png
Views:	309
Size:	118.9 KB
ID:	94751

    Fail to output:

    Click image for larger version

Name:	image.png
Views:	271
Size:	19.5 KB
ID:	94752​​
Working...
X