469,631 Members | 1,776 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Need help for Regex

Hi All,

I want to capture the argument of some javascript function call in HTML
source code, namely HTML-Page contains

<script....>
func ( 'something1\'something2' );
</script...>

or

<script....>
func ( "something1\"something2" );
</script...>

I try to capture whole argument of the function call by the following:

string s = html_source;
Regex re = new Regex(@"(?<a>'.*?(?!<\)')"); // or new
Regex("(?<a>\".*?(?!<\\\\)\")");
Match m = re.Match(s);
Group g = m.Groups["a"];
string r = g.Value;

and here r is <'something1\'> but not <'something1\'something2'> as I want.
What's wrong?

Thanx

Jul 21 '05 #1
0 887

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Michael R. Pierotti | last post: by
1 post views Thread by hillcountry74 | last post: by
9 posts views Thread by jmchadha | last post: by
6 posts views Thread by Extremest | last post: by
7 posts views Thread by Extremest | last post: by
3 posts views Thread by aspineux | last post: by
15 posts views Thread by morleyc | last post: by
3 posts views Thread by =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post: by
4 posts views Thread by Danny Ni | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.