A regular expression is a set of characters and symbols that define a chain as a pattern rather than its elements, for example, if we represent a string of characters that can only be formed by the letters a, b , C and the numbers from 1 to 3, use the following pattern:
Now let’s see the signs basic in regular expressions’ to ‘and its meaning:
represents the group formed by the letters x, y, z find any of these characters.
| [^ xyz]
represents any character not included in the set formed by the letters x, y, z
| (www \ .)?
| Goo gle
| Gooo * gle
represents Google, Goooogle, Goooooogle.
| w (3) \ .
| Go (2.5) gle
| Go (2) gle
Those are the
signs basic regular expressions , we also have the backslash, which is used as an escape character in certain cases, when you want to failing as a special character., * Or?, And to define in other kinds of characters, we see some cases.
| w (3) \.
Define the chain www.
This is a very basic introduction to the use of regular expressions, we have just seen some of the most basic signs, in the next part of this articles we’ll create some expressions a little more complex. Meanwhile some expressions can be tested in regexpal.com, a
interpreter online regular expression .
Also, you may be interested: