eatfishdk Posted November 7, 2008 Share Posted November 7, 2008 HiI'm using the script from this topichttp://www.autoitscript.com/forum/index.ph...l=_EnumWirelessThere is a piece of code:If StringRegExp($objItem.Description, "(?i).*Wireless.*Connection") Then $sWirelessList &= $objItem.Description & "|"Where it looks for a network card with the words "Wireless Connection" in it...I need it to look for that and another description, say "Broadcom 801.11g" and mayby a third type... How the heck do I get that to work, I've tried different types of regex but i simply can't it to work....Please help, Martin Link to comment Share on other sites More sharing options...
zerobazar Posted November 7, 2008 Share Posted November 7, 2008 (edited) If StringRegExp($objItem.Description, "(?i).*\ Broadcom 801\.11g.*") Then $sWirelessList &= $objItem.Description & "|" should make it , I guess. The key thing with your example (Broadcom 801.11g) is to not forget to escape the period (.) of the pattern you are looking for, because they have special meaning within the RegEx. Best Regards. Edit: typo Edited November 7, 2008 by zerobazar Link to comment Share on other sites More sharing options...
eatfishdk Posted November 7, 2008 Author Share Posted November 7, 2008 If StringRegExp($objItem.Description, "(?i).*\ Broadcom 801\.11g.*") Then $sWirelessList &= $objItem.Description & "|" should make it , I guess. The key thing with your example (Broadcom 801.11g) is to not forget to escape the period (.) of the pattern you are looking for, because they have special meaning within the RegEx. Best Regards. Edit: typo Ok, yes, that was one of my problems. But what if I need it to look for both "Broadcom 801.11g" or "Wireless Connection".. Is that possible with regex or should I go for a "if then" solution? The script need to run on different machines with different wireless cards... Martin Link to comment Share on other sites More sharing options...
zerobazar Posted November 7, 2008 Share Posted November 7, 2008 Easy. If StringRegExp($objItem.Description, "(?i).*(Broadcom 801\.11g|Wireless Connection).*") Then $sWirelessList &= $objItem.Description & "|" Best Regards. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now