Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex constraint in $config #19

Open
jongc opened this issue Jul 3, 2018 · 0 comments
Open

Regex constraint in $config #19

jongc opened this issue Jul 3, 2018 · 0 comments

Comments

@jongc
Copy link

jongc commented Jul 3, 2018

Is it possible to use regex for the constraint key in $config? For example, there is a table that has several entries with a similar telephone field name like tel-1, tel-110, tel-211, and so on. I would need the following configurations to cover all of these constraints.

$config['my_table_forms']['field_value'] = [
	[
		'fake_data_type' => 'phoneNumber',
		'constraint'     => [
			'field_name' => [
				'tel-1',
				'tel-110',
				'tel-211',
				// Add more as needed...
			],
		],
	],
];

But something like the following will help me cover the existing constraints and any future ones that follow the same format.

$config['my_table']['field_value'] = [
	[
		'fake_data_type' => 'phoneNumber',
		'constraint'     => [
			'field_name' => [
				'/tel\-\d+/'
			],
		],
	],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant