Jesteś w dziale:
Nowe technologie »
VHS do DVD: kopiowanie kaset vhs oraz materiału z kamer na nośnik DVD. Dowiedz się więcej »




2006-10-03 17:53:44
Grzechuu
2752 postów

wyrażenia regularne


^ Start of line
$ End of line
n? Zero or only one single occurrence of character 'n'
n* Zero or more occurrences of character 'n'
n+ At least one or more occurrences of character 'n'
n{2} Exactly two occurrences of 'n'
n{2,} At least 2 or more occurrences of 'n'
n{2,4} From 2 to 4 occurrences of 'n'
. Any single character
() Parenthesis to group expressions
(.*) Zero or more occurrences of any single character, ie, anything!
(n|a) Either 'n' or 'a'
[1-6] Any single digit in the range between 1 and 6
[c-h] Any single lower case letter in the range between c and h
[D-M] Any single upper case letter in the range between D and M
[^a-z] Any single character EXCEPT any lower case letter between a and z.

Pitfall: the ^ symbol only acts as an EXCEPT rule if it is the
very first character inside a range, and it denies the
entire range including the ^ symbol itself if it appears again
later in the range. Also remember that if it is the first
character in the entire expression, it means "start of line".
In any other place, it is always treated as a regular ^ symbol.
In other words, you cannot deny a word with ^undesired_word
or a group with ^(undesired_phrase).
Read more detailed regex documentation to find out what is
necessary to achieve this.

[_4^a-zA-Z] Any single character which can be the underscore or the
number 4 or the ^ symbol or any letter, lower or upper case

?, +, * and the {} count parameters can be appended not only to a single character, but also to a group() or a range[].

therefore,
^.{2}[a-z]{1,2}_?[0-9]*([1-6]|[a-f])[^1-9]{2}a+$
would mean:

^.{2} = A line beginning with any two characters,
[a-z]{1,2} = followed by either 1 or 2 lower case letters,
_? = followed by an optional underscore,
[0-9]* = followed by zero or more digits,
([1-6]|[a-f]) = followed by either a digit between 1 and 6 OR a
lower case letter between a and f,
[^1-9]{2} = followed by any two characters except digits
between 1 and 9 (0 is possible),
a+$ = followed by at least one or more
occurrences of 'a' at the end of a line.

 


2006-10-04 16:03:44
speco
1 postów


[:alnum:]   znaki alfanumeryczne: `[:alpha:]' i `[:digit:]'.
[:alpha:]   Znaki alfabetu: `[:lower:]' i `[:upper:]'.
[:blank:]   Znaki odstępu: Spacja i tabulacja.
[:cntrl:]   Znaki sterujące. W ASCII mają one kody ósemkowe od 000 do 037, oraz 177 (DEL). W innych zestawach znaków są znakami im równoważnymi, jeśli są takowe.
[:digit:]   Cyfry: 0 1 2 3 4 5 6 7 8 9.
[:graph:]   Znaki graficzne: `[:alnum:]' i `[:punct:]'.
[:lower:]   Małe litery: a b c d e f g h i j k l m n o p q r s t u v w x y z.
[:print:]   Znaki drukowalne: `[:alnum:]', `[:punct:]' i spacja.
[:punct:]   Znaki interpunkcyjne: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~.
[:space:]   Znaki przerwy: Tabulacja, znak nowej linii, tabulacja pionowa, wysuw strony, powrót karetki i spacja.
[:upper:]   Duże litery: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z.
[:xdigit:]   Cyfry szesnastkowe: 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f.

     


2006-10-10 23:22:04
Grzechuu
2752 postów


Ty mi tu nie cwaniakuj:)

     

 
STRONA GŁÓWNA . AKTUALNOŚCI . FORUM . ROZRYWKA . GALERIA . VIDEO . KLIKACZ . KONTAKT   All Rights Reserved  Grzesio.eu © ® 2002-2012.
Zaprojektował: Grzegorz Mistewicz