I'm currently studying regular expression. I didn't really know / understand how to write an expression with 2 condition. Or do I have to write 2 regex for each case?
What I am on is,
I have a txtMobile field in my html field
<label for="txtMobile">Mobile:*</label>
<input id="txtMobile" type="text" name="txtMobile" size="22" maxlength="22">
In my javascript file I'm trying to create a expressions with the following rule
Format: (+##)###-###-####/#### extension is optional and it may start without country code.
Is there any way to do in a single expression or do I have to type if conditions for each case in my javascript file?
Here is what I did /^([0-9]{3})\-([0-9]{3})\-([0-9]{4})\/([0-9]{4})$/