How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Ingo U Your Own Question

Ingo U
Ingo U, Software Engineer
Category: Programming
Satisfied Customers: 755
Experience:  Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
44076068
Type Your Programming Question Here...
Ingo U is online now
A new question is answered every 9 seconds

I'm trying to find an example of a RegEx statement that can

Customer Question

I'm trying to find an example of a RegEx statement that can be used to pull in pages with either the word "apps" or the word "solution" in the URL within BigQuery. Should the regex be applied within a CASE or WHERE statement or can it be defined outside of one of these statements?
Ex.
RegExp("^(word1|word2)$");
...above isn't working, wanting to return all of the following pages with one or both of the words within the statement...
http://domain.com/word1
http://domain.com/word2
http://domain.com/word1/word2
Submitted: 9 months ago.
Category: Programming
Customer: replied 9 months ago.
Here is the BigQuery schema reference to RegEx statements:
https://cloud.google.com/bigquery/query-reference#regularexpressionfunctions
Expert:  Ingo U replied 9 months ago.

Hi,

you probably don't want the regular expression to start with ^ and end with $

Those usually mean "beginning of string" and "end of string", respectively,

so the matching string would have to be entirely word1 or word2, rather than contain either somewhere in it.

So try

RegExp("(word1|word2)");

instead

Hope that helps!

-Ingo U