If letters and digits are allowed, then try this expression (for both cases):
^(\w+)(:\w+)?\.(\w+)$
If digits should not be permitted, then use \p{L}
instead of \w
.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I need to check the validation of format of a string for which i am planning to use Regex. Below is my string format
subject:Patient.name
and also for the presence of string in the below format:
subject.name
I need to validate the above formats exactly as they are. I am thinking of having two different regex for them.
Please suggest how can it be implemented using Regex.
Regards,
Abdi
If letters and digits are allowed, then try this expression (for both cases):
^(\w+)(:\w+)?\.(\w+)$
If digits should not be permitted, then use \p{L}
instead of \w
.