12-01-2009 02:48 AM
Hi all,
what can be a regular expression to search for 2 strings in a line.
ex: corner_fff_dev_26_temp_25_lane_00_vdd_0.95_mode_2.5G.csv
can i be able to search by these 2 combinations. the line changes all the time so just by giving any 2 or multiple parameters by and/or.
1.(temp & mode)
2.(temp or more)
Thanks in advance
12-01-2009 02:57 AM
I am not very clear. Can you tell us the output you want from the line corner_fff_dev_26_temp_25_lane_00_vdd_0.95_mode_2.5G.csv
?
12-01-2009 05:59 AM - edited 12-01-2009 06:00 AM
You can look for one OR the other by using a "|" (pipe); AND is implied.
Edit: the snippet was made with the Code Capture Tool in LabVIEW 8.6.
12-01-2009 03:47 PM
Thanks jim,
if i do (mode.*temp) , returns nothing.
the line which i gave here changes all the time so temp and mode might not be sequential,
so something like google search, you put in keywords and search for them ( match any letter or word or symbol)
is it possible?
12-01-2009 04:40 PM
freemason wrote:Thanks jim,
if i do (mode.*temp) , returns nothing.
the line which i gave here changes all the time so temp and mode might not be sequential,
so something like google search, you put in keywords and search for them ( match any letter or word or symbol)
is it possible?
Try (mode.*temp)|(temp.*mode)
12-01-2009 05:09 PM - edited 12-01-2009 05:11 PM
Alternatively, if you want to make sure you get the numbers/letters after the item, try (mode.*temp[_][0-9]*)|(temp.*mode[_][0-9]*[.]*[0-9]*[A-Z]*)
12-02-2009 06:10 AM
freemason wrote:if i do (mode.*temp) , returns nothing.
The regular expression breaks down like this:
So, "mode.*temp" will look in the string for "mode" with any number of any characters followed by the string "temp". You'll have to configure your search based on what you want to get. I use this site for regexp help.
You might be better off using two searches rather than trying to make one search for everything. This example will only work for mode if it's at the end of the input string. If I knew the exact format I could suggest a regexp that would catch it anywhere.
12-04-2009 02:34 AM
Thanks all,
thanks jcarmody, the regexp help site is very useful