regexsearch Question

I have a grid of data and need to search for specific activities associated with the record. I'm using regexSearch looking for terms like: football, baseball, basketball, golf, tennis, etc. The issue i'm seeing is that search terms "foot" and "football" find the relevant records. However, searching for "ball" returns nothing. Is there another unlisted flag or wildcard option that works with the function? The code below is what is currently active.

regexsearch(
ri!searchBox_text,
fv!item,
"ig"
)

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to kirksain

    If you're attempting to use user-input search terms, then my initial assumption is that you need to transform the user input into something that will work for a regex search pattern.

    regexsearch(
      pattern: "ball",
      searchString: "football games are fun",
      regexFlags: ""
    )
    this just returns "ball", since the regex pattern is not really regex.

    regexsearch(
      pattern: "\S*ball\S*",
      searchString: "some football games are fun",
      regexFlags: ""
    )
    This returns the word "football" (and would also return "basketball" or "ball" or "ballgames" for corresponding inputs) - basically any whole word with "ball" in it.

Children