Regex for parsing clan-leader id

ereinion

Member
I'm trying to write a function which returns the clan leader of my current clan, however I am having a bit of trouble getting my regex to work.

It works fine in the regex-tester I am using, but I suspect there is an issue with the escaping of characters when I try to use it in ash. Can someone give me a clue to where the issue is, please?

Code:
void main() {
    buffer clanInfo;
    matcher m;
    
    clanInfo = visit_url("showclan.php?recruiter=1&whichclan=" + get_clan_id());
    m = create_matcher("Leader:</td><td valign=top><b><a href=\"showplayer\.php\?who=(\d+?)\">", clanInfo);
    
    if (find(m)) {
        print ("test");
        print(group(m,1));
    }
    
}
 

ereinion

Member
Thanks, that worked, although I only had to escape *some* of the backslashes :)

Code:
m = create_matcher("Leader:</td><td valign=top><b><a href=\"showplayer\\.php\\?who=(\\d+?)\">", clanInfo);
 
Top