Thrown when trying to set a {@code value} on the {@code resource} which does not conform to it's regex
423242
public static TransactionException regexFailure(AttributeType attributeType, String value, String regex) {
        return create(ErrorMessage.REGEX_INSTANCE_FAILURE.getMessage(regex, attributeType.label(), value));
    }
201596
@Override
    public void validateDefault(InputProblemReporter rep, boolean normalize)
        throws XMLStreamException
    {
        String def = validateDefaultNmToken(rep, normalize);
        if (normalize) {
            mDefValue.setValue(def);
        }
    }
1186476
public final void elementValuePair() throws RecognitionException {
		int elementValuePair_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 68) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:625:5: ( ( Identifier '=' )? elementValue )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:625:7: ( Identifier '=' )? elementValue
			{
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:625:7: ( Identifier '=' )?
			int alt90=2;
			int LA90_0 = input.LA(1);
			if ( (LA90_0==Identifier) ) {
				int LA90_1 = input.LA(2);
				if ( (LA90_1==54) ) {
					alt90=1;
				}
			}
			switch (alt90) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:625:8: Identifier '='
					{
					match(input,Identifier,FOLLOW_Identifier_in_elementValuePair2383); if (state.failed) return;
					match(input,54,FOLLOW_54_in_elementValuePair2385); if (state.failed) return;
					}
					break;

			}

			pushFollow(FOLLOW_elementValue_in_elementValuePair2389);
			elementValue();
			state._fsp--;
			if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 68, elementValuePair_StartIndex); }

		}
	}
461555
public HttpMediaType setParameter(String name, String value) {
    if (value == null) {
      removeParameter(name);
      return this;
    }

    Preconditions.checkArgument(
        TOKEN_REGEX.matcher(name).matches(), "Name contains reserved characters");
    cachedBuildResult = null;
    parameters.put(name.toLowerCase(Locale.US), value);
    return this;
  }
522427
@Override
    public final void uncheckedSetDiscriminator(String value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "uncheckedSetDiscriminator", value);
        jmo.setField(JsHdrAccess.DISCRIMINATOR, value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "uncheckedSetDiscriminator");
    }
551126
public final void elementValue() throws RecognitionException {
		int elementValue_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 69) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:629:5: ( conditionalExpression | annotation | elementValueArrayInitializer )
			int alt91=3;
			switch ( input.LA(1) ) {
			case CharacterLiteral:
			case DecimalLiteral:
			case FloatingPointLiteral:
			case HexLiteral:
			case Identifier:
			case OctalLiteral:
			case StringLiteral:
			case 29:
			case 36:
			case 40:
			case 41:
			case 44:
			case 45:
			case 53:
			case 65:
			case 67:
			case 70:
			case 71:
			case 77:
			case 79:
			case 80:
			case 82:
			case 85:
			case 92:
			case 94:
			case 97:
			case 98:
			case 105:
			case 108:
			case 111:
			case 115:
			case 118:
			case 126:
				{
				alt91=1;
				}
				break;
			case 58:
				{
				alt91=2;
				}
				break;
			case 121:
				{
				alt91=3;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 91, 0, input);
				throw nvae;
			}
			switch (alt91) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:629:7: conditionalExpression
					{
					pushFollow(FOLLOW_conditionalExpression_in_elementValue2406);
					conditionalExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:630:9: annotation
					{
					pushFollow(FOLLOW_annotation_in_elementValue2416);
					annotation();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:631:9: elementValueArrayInitializer
					{
					pushFollow(FOLLOW_elementValueArrayInitializer_in_elementValue2426);
					elementValueArrayInitializer();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 69, elementValue_StartIndex); }

		}
	}
667301
public static void notPositive(Long value) {
		if(!validation) return;
		notNull(value);
		if(value > 0)
			throw new ParameterException(ErrorCode.POSITIVE);
	}
1281196
private <T> void setValue(final T toReturn, final Method getter, AttributeValue value) {

        Method setter = reflector.getSetter(getter);
        ArgumentUnmarshaller unmarhsaller = reflector.getArgumentUnmarshaller(toReturn, getter, setter);
        unmarhsaller.typeCheck(value, setter);

        Object argument;
        try {
            argument = unmarhsaller.unmarshall(value);
        } catch ( IllegalArgumentException e ) {
            throw new DynamoDBMappingException("Couldn't unmarshall value " + value + " for " + setter, e);
        } catch ( ParseException e ) {
            throw new DynamoDBMappingException("Error attempting to parse date string " + value + " for "+ setter, e);
        }

        safeInvoke(setter, toReturn, argument);
    }
880827
def validate_regex(ctx, param, value):
    
    if not value:
        return None

    try:
        re.compile(value)
    except re.error:
        raise click.BadParameter('Invalid regex "{0}" provided'.format(value))

    return value
969179
public static String asPrettyStringUnchecked(final Object value) {
    try {
      return asPrettyString(value);
    } catch (JsonProcessingException e) {
      throw new RuntimeException(e);
    }
  }
1020268
private static CharSequence validValue(final CharSequence value) {
        if (!RsWithCookie.CVALUE_PTRN.matcher(value).matches()) {
            throw new IllegalArgumentException(
                String.format(
                    "Cookie value \"%s\" contains invalid characters",
                    value
                )
            );
        }
        return value;
    }
1186032
public PactDslJsonArray stringMatcher(String regex, String value) {
        if (!value.matches(regex)) {
            throw new InvalidMatcherException(EXAMPLE + value + "\" does not match regular expression \"" +
                regex + "\"");
        }
        body.put(value);
        matchers.addRule(rootPath + appendArrayIndex(0), regexp(regex));
        return this;
    }
599238
public StringTag setValue(String value) throws UnsupportedEncodingException {
        if (value != null) {
            this.value = value;
        }
        byte[] bb = this.value.getBytes("UTF-8");
        size = VINT.fromValue(bb.length);
        return this;
    }
661928
void valueStrength(String key, @Nullable String value, Strength strength) {
    requireArgument(value == null, "%s does not take a value", key);
    requireArgument(valueStrength == null, "%s was already set to %s", key, valueStrength);
    valueStrength = strength;
  }
581754
public void setValue(String value) {
		contents = new ArrayList();
		contents.add(value);
		if (value.trim().length() > 0) {
			containsSingleString = true;
		}
	}
915784
private void putWithValidation(String key, Object value) throws BitcoinURIParseException {
        if (parameterMap.containsKey(key)) {
            throw new BitcoinURIParseException(String.format(Locale.US, "'%s' is duplicated, URI is invalid", key));
        } else {
            parameterMap.put(key, value);
        }
    }
1139165
function(value, element, param) {
			param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
			return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); 
		}