Re: parsing special characters in perl



Thanks so much Thomas.
It worked

Thomas J. wrote:
soyebb@xxxxxxxxx schrieb:


if($subject =~
m/Read\s*product\s*information\s*for\s*the\s*([\s\w\&\:\;\"\'\-\_\>\<\\\/\)\(,\.\?\!\~\%\*\+\=\@\$]+)/gi)


the line parses everything after 'the' like it parseses "AMD Athlon"
but when it encounters the TM (symbol) it drops everything after that.
When I need everything till the end of line.

... end of your variable, i think?


Is there a special symbol / wild card character that i can include in
this regular expression so as to keep parsing the text till the end of
line.


the answer depends on the charset of your input.
The "TM"-glyphe is not in your Character-Class.
If you want all to "end-of-line", why not using
(.+) instead of
([\s\w\&\:\;\"\'\-\_\>\<\\\/\)\(,\.\?\!\~\%\*\+\=\@\$]+) ?

Thomas

.