BookmarkSubscribeRSS Feed
McSquarewolf
Calcite | Level 5

Using wildcards with regex_count. In snowflake directly, this syntax  below will be accepted.  But in sas there is an issue with the wildcard at the end that I can't figure out how to workaround.  It seems to look at it like I'm incorrectly trying to comment something out. Syntax below is looking for "all your questions" essentially, with word distance in between and a wildcard on question* to account for text-to-speech inaccuracies. Even though I could use more iterations of question(s)(ing), would like to know if anyone has a solution for future wildcard needs like this scenario.  Thanks you for any help you can provide in answering this question.

 

REGEXP_COUNT(LOWER(TranscriptFieldName), '\\b(all)([,.!?]? ?\\b[^\\s]+\\b[,.!?]?){0,3}[,.!?]? (your|you\'re)([,.!?]? ?\\b[^\\s]+\\b[,.!?]?){0,3}[,.!?]? question[a-z]*\\b')

3 REPLIES 3
Tom
Super User Tom
Super User

So that is not SAS code.  What is the SAS code you are running?  Are just use PROC SQL to submit that code directly to SNOWFLAKE?  If so please show the SAS code.  If you get an error message include the SAS log.

 

Make sure to use the Insert Code or Insert SAS code button on the forum editors menu bar to paste in the text from your log or program.

McSquarewolf
Calcite | Level 5
That's a good point, my fault. Where I'm having trouble is using this
syntax in a pass through to snowflake in a sas job.
Tom
Super User Tom
Super User

Please show the actual code you used.  

SAS has three types of comments and none of them are in the snippet you showed.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1396 views
  • 0 likes
  • 2 in conversation