I am using QueryCredentialsAttributes() function to get username along with domain name in my code but function returning domain name in uppercase letters sometimes and Lowercase letters some times.
How to make it stable to return domain only in uppercase letters.
Related
i have an ID in a url. its like this
http://mysite.test/category/subcategory/title-13
now in Laravel.
i want to parse this part of URL in my web.php route file so that i can detect and pass them in a function.
category/subcategory/title-13
and route must be like this.
Route::get('{category}/{subcategory_slug}/{slug}-{id}/', 'ItemsController#item')
i tried this but its not working. because of "-"
and here title has dashes (-) into it as well. like
http://mysite.test//jobs/articles/get-your-dream-job-16
Your slug placeholder consumes everything up to the next slash, including the -, so the rest never matches.
Laravel lets you add your own pattern against which to match a placeholder, using the where method.
If you set your slug's pattern to exclude the - character, it should work as you expect.
Route::get('{category}/{subcategory_slug}/{slug}-{id}/', 'ItemsController#item')
->where('slug', '[^-]+');
If your slug itself contains dashes, then you can use a lookahead to make sure there's always at least one dash left:
Route::get('{category}/{subcategory_slug}/{slug}-{id}/', 'ItemsController#item')
->where('slug', '.+(?=-)');
As per the FHIR spec, the id datatype supports the following characters -
'A'..'Z', and 'a'..'z', numerals ('0'..'9'), '-' and '.'
However, when generating FHIR responses from our SoR, we are creating the "id" value (resource.id) of some resources dynamically by using keywords/terminology used in the SoR and some of these keywords contain the '_' character. This results in the generated "id" value also containing '_' characters. Subsequent URL invocations or reference URLs to such resources have '_' characters in them (the "id" in the "..resource/{id}" snippet).
While RFC3986 indicates that '_' are okay to be used in URLs, is there any reason that '_' is restricted from being used in "id" values in FHIR?
There's not a deep connection between the characters we allow in FHIR IDs and the characters allowed in a URL -- except that FHIR's design ensures that FHIR IDs are always valid path segments.
One reason we omit _ from the allowed characters in a FHIR ID is to avoid ambiguity in cases like:
GET /Patient/_search
... where http://hl7.org/fhir/http.html#search ensures that _search is a reserved word. By omitting _ (and $ for that matter) from valid FHIR IDs, we ensure that _search can never accidentally be parsed as a resource ID.
Im trying to work out how to put an input mask on initials which will allow for initials that are two/three letters on.
I have tried entering >L?L< but this only allows three letter initials to be entered and not two letter initials.
Is there another symbol I should be using other than '?' that means that the user does not have to enter a character in that place?
I would suggest >LL?
> forces everything to uppercase
L is a required character
? is an optional character
I understand that Codeigniter has built in security that will url decode a URL before it checks on whitelisted special characters. For example, if I have a URL containing %3d, Codeigniter decodes to an = sign, then checks if = is whitelisted.
But what if I need to pass %3d just as is, without it being decoded and then compared to a whitelist, except where I have whitelisted a % sign? I just want to pass in %3d and get %3d back, without having to add = to my white list. Is there any way to do this?
The CodeIgniter checks if the value of a key has permitted characters, and you can configure this with the $config['permitted_uri_chars'], but the error message you get is about the key itself not about its value. The $config['permitted_uri_chars'] doesn't help you to allow the % symbol in this case.
You will find the function function _clean_input_keys($str) that checks the keys in system/core/input.php (Line 727). The % character is not allowed so '%40' will not pass:
if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
The only way around this in your case is to avoid this character in key parameters.
I need create a regular expression for validate the first and second name of a person. The second name is optional because there are people without second name. The space character can be between the two names, but it can not be the end of string
example
"Juan Perez" is valid
"Juan Perez " is invalid because there is a space character the end of the string
You could use the below regex which uses an optional group.
^[A-Za-z]+(?:\s[A-Za-z]+)?$
(?:\s[A-Za-z]+)? optional group will do a match if there is a space followed by one or more alphabets. It won't match the string if there is only a single space exists. And also it asserts that there must be an alphabet present at the last.
DEMO
Update:
If the user name contains not only the firstname but also middlename,lastname ... then you could use the below regex. * repeats the previous token zero or more times where ? after a token (not of * or +) will turn the previous token as an optional one.
^[A-Za-z]+(?:\s[A-Za-z]+)*$
How about a way that doesn't require repeating the char class:
^\b(\s?[[:alpha:]]+)+$