There are many different possibilities to answer this question. We will go top down beginning with the browser.
Most of the browsers support the html input tag of type "email" and most of them would automatically warn the user about a wrong format of the address. However there are many standards of email address pattern. Furthermore the user might disable the browser validation, so we should not rely on this.
The second station is the javascript of the browser. Probably the easiest way to validate the email address is to use a regular expression an match the input against this expression. However the user may disable the javascript or send a request in other way than browser. Therefore it's absolutely necessary to validate the email address on the server side. This might be done by a regular expression, but some more sophisticated systems would check the MX record of the domain given in the email address, to be sure it might be a real address of a real mail server.




Replacing String in JavaScript with Regular Expression and the replace function


  1. searching the web for replacing texts
  2. finding regular expression
  3. searching for suitable regex function
  4. identifying replace out of (match, exec, replace) as the most suitable function to use
  5. searching for example how to use replace the right way
  6. finding and testing the right pattern that matches /s200/
  7. testing and iterating until the pattern matches the string and the modified string is ready to use

a javascript solution for that particular challenge looks the following way:

var testString = "";
var partToBeReplaced = /s200/;
var newPart = "s1600";
var replacedTestString = testString.replace(partToBeReplaced, newPart);

Number of words of a String in a WebL program

I was searching for an easy way to count the words of a given String in a WebL program. WebL is considered as outdated, so it was difficult to find information online.
Subscribe to RegEx