'컴퓨터/language'에 해당되는 글 2건

  1. 2006/09/15 Rich Edit Control
  2. 2006/05/12 Regular Expression

Rich Edit Control

Rich Edit Control 컴퓨터/language 2006/09/15 14:22
Rich Edit Control 2.0

삽질 로그

문제: Rich Edit Control 추가를 했더니 다이얼로그가 안뜬다.
해결: AfxInitRichEdit2();

문제: 마우스 이벤트를 잡고 싶다.
시도: 그냥은 안되더군 -_ -;
해결: CRichEditCtrl를 상속 받는 클래스를 하나 만들고 그 안에서 처리해 주어야 함.

문제: 휠은?
시도: 휠관련 메시지를 그냥 추가했더니 안되넹.
해결: 포커스를 줘야 한다 ㅡㅡ;;;

문제: 출력 문자가 길어지니 좀 짤리네?
해결: LimitText(int);
Posted by Hikasiru

Regular Expression

Regular Expression 컴퓨터/language 2006/05/12 15:00
Table 4-2. Regular expression metacharacter syntax

Subexpression

Matches

Notes

General

^

Start of line/string

 

$

End of line/string

 

\b

Word boundary

 

\B

Not a word boundary

 

\A

Beginning of entire string

 

\z

End of entire string

 

\Z

End of entire string (except allowable final line terminator)

 

.

Any one character (except line terminator)

 

[...]

"Character class"; any one character from those listed

 

[^...]

Any one character not from those listed


 

Alternation and grouping

(...)

Grouping (capture groups)


 

|

Alternation

 

(?:re)

Noncapturing parenthesis

 

\G

End of the previous match

 

\n

Back-reference to capture group number "n"

 

Normal (greedy) multipliers

{m,n}

Multiplier for "from m to n repetitions"

 

{m,}

Multiplier for "m or more repetitions"

 

{m}

Multiplier for "exactly m repetitions"

 

{,n}

Multiplier for 0 up to n repetitions

 

*

Multiplier for 0 or more repetitions

Short for {0,}

+

Multiplier for 1 or more repetitions

Short for {1,}

?

Multiplier for 0 or 1 repetitions (i.e, present exactly once, or not at all)

Short for {0,1}

Reluctant (non-greedy) multipliers

{m,n}?

Reluctant multiplier for "from m to n repetitions"

 

{m,}?

Reluctant multiplier for "m or more repetitions"

 

{,n}?

Reluctant multiplier for 0 up to n repetitions

 

*?

Reluctant multiplier: 0 or more

 

+?

Reluctant multiplier: 1 or more

 

??

Reluctant multiplier: 0 or 1 times

 

Possessive (very greedy) multipliers

{m,n}+

Possessive multiplier for "from m to n repetitions"

 

{m,}+

Possessive multiplier for "m or more repetitions"

 

{,n}+

Possessive multiplier for 0 up to n repetitions

 

*+

Possessive multiplier: 0 or more

 

++

Possessive multiplier: 1 or more

 

?+

Possessive multiplier: 0 or 1 times

 

Escapes and shorthands

\

Escape (quote) character: turns most metacharacters off; turns subsequent alphabetic into metacharacters

 

\Q

Escape (quote) all characters up to \E

 

\E

Ends quoting begun with \Q

 

\t

Tab character

 

\r

Return (carriage return) character

 

\n

Newline character


 

\f

Form feed

 

\w

Character in a word

Use \w+ for a word;

\W

A non-word character

 

\d

Numeric digit

Use \d+ for an integer;

\D

A non-digit character

 

\s

Whitespace

Space, tab, etc., as determined by java.lang.Character.isWhitespace( )

\S

A nonwhitespace character


 

Unicode blocks (representative samples)

\p{InGreek}

A character in the Greek block

(simple block)

\P{InGreek}

Any character not in the Greek block

 

\p{Lu}

An uppercase letter

(simple category)

\p{Sc}

A currency symbol

 

POSIX-style character classes (defined only for US-ASCII)

\p{Alnum}

Alphanumeric characters

[A-Za-z0-9]

\p{Alpha}

Alphabetic characters

[A-Za-z]

\p{ASCII}

Any ASCII character

[\x00-\x7F]

\p{Blank}

Space and tab characters

 

\p{Space}

Space characters

[ \t\n\x0B\f\r]

\p{Cntrl}

Control characters

[\x00-\x1F\x7F]

\p{Digit}

Numeric digit characters

[0-9]

\p{Graph}

Printable and visible characters (not spaces or control characters)

 

\p{Print}

Printable characters

Same as \p{Graph}

\p{Punct}

Punctuation characters

One of !"#$%&'( )*+,-./:;<=>?@[\]^_`{|}~

\p{Lower}

Lowercase characters

[a-z]

\p{Upper}

Uppercase characters

[A-Z]

\p{XDigit}

Hexadecimal digit characters

[0-9a-fA-F]

Posted by Hikasiru
1 
하단 사이드바 열기

BLOG main image