// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

shader v_subj_u_pattern (output vector cout = 0)
{
    string v_subj = concat(format("%g", P[0]), " electric blue");

    //printf("%s", v_subj);
   
    int a = 3;
    int b = 2;
    int c = 5;
    int d = 1;
    int e = 6;
    int f = 8;

    a =  regex_match (v_subj, "ham");         // should not match
    b =  regex_match (v_subj, "ue");  // should match
    c =  regex_match (v_subj, "$el");
    d =  regex_match (v_subj, "el[a-b]");
    e =  regex_match (v_subj, ".*tric");       // should match
    f =  regex_search (v_subj, "blue");

    cout = vector(a+b/u, (c+d/v+u), (e*f/v*u));
}
