BasicOptions.sql 828 B

12345678910111213141516171819202122
  1. /* syntax version 1 */
  2. $options = Re2::Options(true as Utf8);
  3. $match = Re2::Match("[ax]+\d",$options);
  4. $grep = Re2Posix::Grep("a.*",$options);
  5. $capture = Re2::Capture(".*(?P<foo>xa?)(a{2,}).*",$options);
  6. $replace = Re2::Replace("x(a+)x",$options);
  7. $count = Re2::Count("a",$options);
  8. -- regex to find all tokens consisting of letters and digist
  9. -- L stands for "Letters", Nd stands for "Number, decimal digit",
  10. -- see https://en.wikipedia.org/wiki/Unicode_character_property#General_Category
  11. $find_and_consume = Re2::FindAndConsume('([\\pL\\p{Nd}]+)',$options);
  12. SELECT
  13. value,
  14. $match(value) AS match,
  15. $grep(value) AS grep,
  16. $capture(value) AS capture,
  17. $capture(value)._1 AS capture_member,
  18. $replace(value, "b\\1z") AS replace,
  19. $count(value) AS count,
  20. $find_and_consume(value) AS tokens
  21. FROM Input;