locked
Split Data - Regular expression exact match RRS feed

  • Question

  • Hi

    I am using the split data module in my experiment to filter my data set, what is the regular expression syntax for an exact string match ?

    I am using:

    \"ColumnA" string

    But this does a contains & returns everything with 'string' in it, I want it to return the exact match only eg.

    = 'string'

    Cheers

    Tuesday, December 5, 2017 4:07 PM

Answers

  • Hi,

    Perhaps you can use the 'Apply SQL Transformation' module to do this filtering of records.

    Example:

    select * from t1 where t1.make="audi";

    Sample experiment:

    Regards,
    Jaya

    Tuesday, December 5, 2017 10:07 PM
  • You can use the symbol ^ to constrain the search string to the beginning of the string, and the $ symbol to specify that it occur at the end of the string.

    For example, this expression returns rows that contain "Fred" anywhere in column myText

    \"myText" Fred

    This expression returns only the rows where "Fred" occupies all of column myText

    \"myText" ^Fred$

    Tuesday, December 5, 2017 11:59 PM

All replies

  • Oh I also interested in this one
    Tuesday, December 5, 2017 4:29 PM
  • Hi,

    Perhaps you can use the 'Apply SQL Transformation' module to do this filtering of records.

    Example:

    select * from t1 where t1.make="audi";

    Sample experiment:

    Regards,
    Jaya

    Tuesday, December 5, 2017 10:07 PM
  • You can use the symbol ^ to constrain the search string to the beginning of the string, and the $ symbol to specify that it occur at the end of the string.

    For example, this expression returns rows that contain "Fred" anywhere in column myText

    \"myText" Fred

    This expression returns only the rows where "Fred" occupies all of column myText

    \"myText" ^Fred$

    Tuesday, December 5, 2017 11:59 PM
  • Thanks, knew it must have been something straightforward :)
    Wednesday, December 6, 2017 7:53 AM
  • Thanks, missed this module never knew it existed !
    Wednesday, December 6, 2017 7:53 AM
  • Good to hear this helps, thanks for the confirmation.
    Wednesday, December 6, 2017 2:55 PM