bjnst6
October 10th, 2002, 07:45 PM
yes indeed...
I have a string that looks like this:
"This is always the same, same, same, but this color name here: yellow could be anything"
I need to search for all the occurences of this string. Now the problem comes in because I need to search for the length of the whole string from "This" to "anything" and return that whole part of it...but the color name could be anything, of any LENGTH. now it's separated by the same characters on each side...like spaces here for instance, so I know when the word ends (they're will be a space...but it could be "red" or "green", etc.
my question is how do i set the regular expression to be okay with finding anything in place of the "yellow" of any length?
this code will work as a search string if the color name is a fixed number of characters, like 6 in the "yellow" example above...but it won't be:
RegExpTest "This is always the same, same, same, but this color name here: ...... could be anything", testFile
any ideas?
word,
b
I have a string that looks like this:
"This is always the same, same, same, but this color name here: yellow could be anything"
I need to search for all the occurences of this string. Now the problem comes in because I need to search for the length of the whole string from "This" to "anything" and return that whole part of it...but the color name could be anything, of any LENGTH. now it's separated by the same characters on each side...like spaces here for instance, so I know when the word ends (they're will be a space...but it could be "red" or "green", etc.
my question is how do i set the regular expression to be okay with finding anything in place of the "yellow" of any length?
this code will work as a search string if the color name is a fixed number of characters, like 6 in the "yellow" example above...but it won't be:
RegExpTest "This is always the same, same, same, but this color name here: ...... could be anything", testFile
any ideas?
word,
b