LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  * in Brainscript

    Employee
    Posted 04-22-2016 04:18

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: cpapageo

    How can i get in output all fields with strings that start with the same characters? (eg Chris, Chris101, ChrisMalc)
    Which character can be used for this reason instead of * (that seems it does not work)?


  • 2.  RE: * in Brainscript

    Employee
    Posted 04-22-2016 05:20

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Two ways

    emit * where myField.left(5)=="Chris"

    or

    emit * where myField.regexIsMatch("^Chris*")

    =====
    For full documentation on the Regex functions, visit pcre.org or http://pcre.org/original/doc/html/


  • 3.  RE: * in Brainscript

    Employee
    Posted 04-22-2016 05:50

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    There are also the pattern and wildcard operators

    emit pattern "Chris.+"

    and

    emit wildcard "Chris*"

    See the pattern and wildcard sections in the Language Elements section of the BRAINScript help.


  • 4.  RE: * in Brainscript

    Employee
    Posted 04-22-2016 06:05

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Adrian is correct if you're looking to select columns by Name...
    I was thinking that you wanted specific rows where there is a Value that starts with "Chris"


  • 5.  RE: * in Brainscript

    Employee
    Posted 04-22-2016 06:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: cpapageo

    Originally posted by: stonysmith
    					

    Two ways

    emit * where myField.left(5)=="Chris"

    or

    emit * where myField.regexIsMatch("^Chris*")

    =====
    For full documentation on the Regex functions, visit pcre.org or http://pcre.org/original/doc/html/
    Thank you for the useful tip but I'm trying this:

    emit * where 'ACProduct Code' <> "ACM*" and 'ppProduct Code' <> "PPS*"

    unsuccessfully...


  • 6.  RE: * in Brainscript

    Employee
    Posted 04-22-2016 06:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    emit * where 'ACProduct Code'.left(3) <> "ACM" and 'ppProduct Code'.left(3) <> "PPS"

    or

    emit * where not 'ACProduct Code'.regexIsMatch("^ACM*") and not 'ppProduct Code'.regexIsMatch("^PPS*")


  • 7.  RE: * in Brainscript

    Employee
    Posted 04-22-2016 06:26

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: cpapageo

    It worked. Thanks a lot!