0

I have a trouble in correlating a Link ID which is some value inside changes from link to link. so I need to create a regular expression to handle all of the variable values in the page.

below are the lines of code I use :

web_reg_save_param("corr_activitysubcategory", 
    "LB/IC=categorysearchCats_lnkCat_16\" href=\"/category/Search.aspx\?s=&t=4&f=28&v=",
    "RB/IC=&sh=0&", 
    "Ord=all", 
    "Notfound=warning",
    "Search=body", 
    "RelFrameId=1", 
    LAST);

the number (16) is varies for each link... so I need to put a regular expression to ignore the number. I tried put .* instead of 16 but it results in no data matched.

Manaysah
  • 375
  • 5
  • 15
  • 29
  • If you post two possible strings and the value you want to extract it would be easier to help you. – Buzzy May 02 '13 at 08:26
  • thanks Buzzy, as I mentioned above the 16 number is varies, value are number from (0 to 20) for each link. so i want to replace it with a regular expression pattern which will ignore the number at all. I hope you get my want now. – Manaysah May 02 '13 at 08:45

2 Answers2

1

Try this regular expression:

categorysearchCats_lnkCat_[0-9]+\" href=\"/category/Search.aspx

Buzzy
  • 2,905
  • 3
  • 22
  • 31
0
web_reg_save_param("corr_activitysubcategory", 
    "LB/ALNUMIC=categorysearchCats_lnkCat__^\" href=\"/=\"/category/Search.aspx\?s=&t=4&f=28&v=",
    "RB/IC=&sh=0&", 
    "Ord=all", 
    "Notfound=warning",
    "Search=body", 
    "RelFrameId=1", 
    LAST);

the issue solved using "LB/ALNUMIC" tag, which accepts regular expressions.

Piotr Rochala
  • 7,748
  • 2
  • 33
  • 54
Manaysah
  • 375
  • 5
  • 15
  • 29