on 05-05-2010 7:37 AM
Hi,
how to find string as per search pattern given by user ?
regex method 'find' (boolean matchFound = matcher.find();) searches for occurance of exact string
but requirement is that if user gives AS then result list should consider the search pattern like starting from A and containing S
thanks in advance for help
b
Hi,
Could you please specify whether you are using this in message mapping and AS is an identifier or what?
cheers,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
I followed this link and it works for me
Link:[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1624] [original link is broken];
but i preceded * with . myself so that end user doesnt have to do it (pl refer link for details)
patternStr0= //give the filter value given by user
patternStr="";
char c = '*';
char fieldValueCharArray [] = patternStr0.toCharArray();
for (int i = 0; i < fieldValueCharArray.length; i ++) {
if (fieldValueCharArray<i> != '\\')
{
if (fieldValueCharArray<i> == c) patternStr += "."+fieldValueCharArray<i>;
else patternStr += fieldValueCharArray<i>;
}
}
boolean match = inputStr.matches(patternStr);
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what are you talking about?
Is this PI related?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.