- pLv 61 十年前最愛解答
Many unix/linux related utilities(vi, perl) and other languages (Java, SQL) use regular expressions to search for patterns.
We write a 'pattern' to match for texts. The pattern can be simply a normal text, for example:
/ABC/ will match 'As easy as ABC.', because the pattern ABC is present in the given string.
On the other hand,
/ABC/i will match any combination of cases, so a match will be found for
'As easy as Abc' or 'As easy as abc'.
Sometimes, to match only certain combinations of characters, we can use the character group:
/[abc][ABC]/ will match any combination of one letter of a,b or c followed by A, B or C, such as aB, cA, aA, etc.
It is a very interesting subject if you are in programming, or using utilities like Perl, awk, vi, sed, grep, Java or SQL.
You can find more information at the following link: