How to add a mask of the Russian phone number +7 (___) ___-__-__? - mask

I am interested in how to add a mask of a Russian phone number in the format
+7 (___) ___-__-__.

Check the "Custom" option, then set the mask value to +7 (999) 999-99-99

Related

DICOM VR ST with multiple value

If I read the definition of DICOM VR ST, short text:
A character string that may contain one or more paragraphs. It may
contain the Graphic Character set and the Control Characters, CR, LF,
FF, and ESC. It may be padded with trailing spaces, which may be
ignored, but leading spaces are considered to be significant. Data
Elements with this VR shall not be multi-valued and therefore
character code 5CH (the BACKSLASH "\" in ISO-IR 6) may be used.
So, the data element shall not be multi-valued.
But, I found a few DICOM Tag in the dictionary that has DICOM VR=ST and DICOM VM=1-n, which is multi-valued.
For example:
(0014,0023) CAD File Format
And few others from (0014,...)
So, how should I understand this? Is the DICOM VR definition wrong ?
AFAIK the definition of Short Text is correct and the VR should be always 1.
The Tags 0014,0023 and 0014,0024 are retired anyway.

Adding glyphs to Fontforge

When I open Fontforge to create a new font, it only lists a limited set of characters / glyphs. In the font I create, I need some glyphs that are missing from that default set, e.g. "single right-pointing angle quotation mark" (U+203A) and "single left-pointing angle quotation mark" (U+2039).
How can I add "slots" for these glyphs, or rather:
What is the proper way to add glyphs that are defined in the Unicode table?
Ah, well, just go to Encoding > Add encoding slot, then there will be a dialog to set how many slot(s) you want to add.
Ah, well, just go to Encoding > Reencode and choose an encoding that contains the relevant slots.

Creating a password regex

Right now I need to duplicate a password expression validator for a website. The password is only required to be 8-25 characters (only alphabet characters) long. I thought this was weird and had been using this regex
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,25})
but it has to be optional to have a capital letter, special characters and/or numbers throughout the password. I'm not particularly apt at building regex's where there are optional characters. Any help would be be appreciated.
I am using asp.net's RegularExpressionValidator.
This pattern should work:
^[a-zA-Z]{8,25}$
It matches a string consisting of 8 to 25 Latin letters.
If you want to allow numbers as well, this pattern should work:
^[a-zA-Z0-9]{8,25}$
It matches a string consisting of 8 to 25 Latin letters or decimal digits.
If you want to allow special characters as well, this pattern should work:
^[a-zA-Z0-9$#!]{8,25}$
It matches a string consisting of 8 to 25 Latin letters, decimal digits, or symbols, $, # or ! (of course you can add to this set fairly easily).
Your current regex won't work because it will accept special characters as from 9th character (and anything after the 9th character in fact, even a 26th character because you don't have the end of string anchor) .
You probably want something like this:
^(?=.*[a-z])[A-Za-z0-9]{8,25}$
This first makes sure there are lowercase alphabets (you mentioned that uppercase and digits are optional, so this makes obligatory lowercase) and then allows only uppercase and digits.
EDIT: To allow any special characters, you can use this:
^(?=.*[a-z]).{8,25}$
My understanding of your problem is that the password's first requirement is that it has to contain lowercase alphabet characters. The option now is that it can also contain other characters. If this isn't right, let me know.
regex101 demo

gridview dataformatstring custom currency

IS there any way, using the dataformatstring, to move the Euro (€) currency symbol to the beggining of the value without hardcoding the euro symbol in the xml?
Example : Using {0:C} I get 1234€ and what i want is to get €1234 . I can't find a solution for this without having to hardcode de euro symbol like €{0:g} .
Any clue ?
Regards
You need to set the CurrencyPositivePattern to 0:
NumberFormatInfo nfi = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
nfi.CurrencyPositivePattern = 0;
You will likely want to set the CurrencyNegativePattern as well. The link provides all of the patterns.
It would seem safest to specify the default currency symbol.
As whatever your defualt culture is (e.g in case of French Currrency there is a dual currency either it can be the local currency or euros)
NumberFormatInfo numberFormatInfo= (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
numberFormatInfo.CurrencySymbol = "€";

Printing ASCII value of BB (HEX) in Unix

When I am trying to paste the character » (right double angle quotes) in Unix from my Notepad, it's converting to /273. The corresponding Hex value is BB and the Decimal value is 187.
My actual requirement is to have this character as the file delimiter when I export a .dat file from a database table. So, this character was put in as the delimiter after each column name. But, while copy-pasting, it's getting converted to /273.
Any idea about how to fix this? I am on Solaris (SunOS 5.10).
Thanks,
Visakh
ASCII only defines the character codes up to 127 (0x7F) - everything after that is another encoding, such as ISO-8859-1 or UTF-8. Make sure your locale is set to the encoding you are trying to use - the locale command will report your current locale settings, the locale(5) and environ(5) man pages cover how to set them. A much more in-depth introduction to the whole character encoding concept can be found in Joel Spolsky's The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
The character code 0xBB is shown as » in the IS0-8859-1 character chart, so that's probably the character set you want, so the locale would be something like en_US.ISO8859-1 for that character set with US/English messages/date formats/currency settings/etc.

Resources