02-15-2011 08:46 PM
Hi,
I have get the attached file details from command prompt.
I would like to know, is there any method can get the mac address string only? Which is "00-04-A3-12-32-25" and filter out the others detail.
Thanks.
Solved! Go to Solution.
02-15-2011 09:18 PM
Regex to the rescue.
02-15-2011 09:31 PM
Between, my labview version is 8.5.1. Thanks
02-15-2011 09:46 PM
You can just paste this regex into the constant for Match Regular Expression
([[:xdigit:]]{2}-){5}[[:xdigit:]]{2}
8.5 vi attached
02-15-2011 09:57 PM
Oh, thank you. My problem is solved.
Between, may i know where can i get the definition for all these regular expression? ([[:xdigit:]]{2}-){5}[[:xdigit:]]{2}
Thanks.
02-15-2011 10:21 PM
I always refer to this page: www.pcre.org
In this case: ([[:xdigit:]]{2}-){5}[[:xdigit:]]{2} translates to:
Look for 2 hex digits followed by -, all repeated 5 times followed by two more hex digits.
02-15-2011 10:31 PM
Hi Darin,
Thanks for your information and the solution.
Have a nice day.
02-20-2011 08:58 PM
Hi,
I have one more step to do. If I would like to filter out the '-' in between the number from attached vi. How can i do it?
Example:
From: 00-04-A3-12-32-25
To: 0004A3123225
Appreciate your feedback.
Thanks.
02-20-2011 10:57 PM
02-20-2011 11:16 PM
Hi Darin,
Yeah this is exactly the solution. I have solved my problem.
Thanks.