regular expression question

Status
Not open for further replies.

txdx2005

Member level 1
Joined
Jul 15, 2006
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,610
how to extract out the line number and filename from string by regular expression
the string is :

*** ERROR C141 IN LINE 436 OF G:\KEIL\SMS\TEST.C: syntax error near 'while'

The following special characters are interpreted in regular expressions

Table 4.3: Regular Expression Characters
Character
Matches

^ (at the beginning only)
beginning of line

.
any single character

[abc]
any single character that belongs to the set abc

[^abc]
any single character that does not belong to the set abc

*
zero or more occurrences of the preceding character

+
one or more occurrences of the preceding character

\t
a tab character

\s
a space character

\w
white space (a tab or a space character)

$
the end of the line


Sets, such as [abc] may be in the following formats.

Table 4.4: Regular Expression Sets
Set type
Meaning

[<character list>]
eg. [abcde]
Matches any character within the set. The set can be any number of characters long.

[x-y]
eg. [a-z]
Matches on any character within the range of x through y, inclusively. The ASCII value of x must be less than that of y.

combination;
eg. [WXYa-z0-9]
Character lists and ranges may be combined.




--------------------------------------------------------------------------------

Added after 4 minutes:

this use in sourceinsight "Parse Source Links "
i dont know how t write this expression.
default pattern is " ^\([a-zA-Z].*\)(\([0-9][0-9]*\)).* "
 

i use c51.how to the regular expreesion
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…