Sei sulla pagina 1di 1

We search letter by letter with regular expressions. Use g flag to continue searching after the first match.

The ? symbol means that the preceeding character or token is optional. Spaces are characters too. Use () to group a bunch of characters. Use a 'character class' [] to match one of the characters from the list. e.g. [a bclne] will match any one of the characters from the list. + matches 1 or more of the preceeding token. e.g. asggggggggggg now using g+ wil l find the sequence of g's. * matches 0 or more of the preceeding token. Use | (pipe) symbol to use it as an or. e.g. red | green means either red or gre en. Use ^ to select the starting token in the string. Use $ to select the last token in the string. e.g. let's say we have 3 files myj pg.jpg,123.png,love.gif if we want to select the extentions of these files we would write (jpg|gif|png)$ this will select all the strings that have any of these tokens at the end. \d refers to any digit character (0-9). Use {} to specify the minimum and the maximum number of characters to match. Above And Beyond - Trance Around The World 396

Potrebbero piacerti anche