where _ represents a single character.
We can go with index() function if we dont have any single char match there.
How this can be handled in transformer?
Can you be more specific regarding what you mean by "where _ represents a single character"? I'm unclear what the requirement is or what the underscore represents here... it must be a character rather than a number?
Typically when you want to do "like xxx%", meaning the string starts with a certain pattern, you can do a simple substring equality match but I can't tell if that would be appropriate here.
-craig
"You can never have too many knives" -- Logan Nine Fingers
The original post is somewhat vague it the example looks like SQL, in which the % sign is a wildcard representing zero or more of any character, and also in which the _ is a wildcard representing any one character (standard SQL).
If you want to match on the % sign literally then use Kandy's first example.
If your unspoken rule is to handle % as standard SQL wildcard then use Kandy's second example.
Last edited by qt_ky on Thu Apr 19, 2012 9:46 pm, edited 1 time in total.
Choose a job you love, and you will never have to work a day in your life. - Confucius
pandeesh wrote:Yes kandy. Thats the way I was also thinking about .
But when we have the pattern like %a_b%, I don't know how to match all the possible patterns .
That is also possible. No time to give you the code.
Find the location of first 'a' using Index, then add 3 to it and see whether the character in that location is 'b'. That's it.
Kandy
_________________
Try and Try again…You will succeed atlast!!
It will become some more complex that if the number of a are more in the string and only one pattern is matching .
So we nee to recursively apply for all the occurrence of a .
Thanks for your help all