How to search special characters in a string
Hi all,
I want to search special characters in all string columns and all rows in the table.
The table has about 5 string columns and about 5.000.000 rows. For each row and column, I have to search entries, which included special characters like ", !, ? or something else (f.ex. "Mama?Mia" or "!!!Hotel out of order!!!"). The problem, the character could stand at each position in the string.
What's the best and most performance possibility to search such entries?? Is it possibility only by SQL; is there a special function for this?? Or must I use PL/SQL.
Thanks for helping
Dana
HTH
Laurent Schneider
OCM DBA
SQL> select * from z;
S
Mama?Mia
a b c
123
SQL> select * from z where translate(s,'~ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz1234567890','~') is not null;
S
Mama?Mia
SQL> select * from z where regexp_like(s, '[^[:alnum:][:space:]]');
S
Mama?Mia
Similar Messages
-
RegExp for excluding special characters in a string.
Hi All,
Im using Flex RegExpValidator. Can anyone suggest me the correct expression to validate this condition?....
I have tried this expression :----- /^[^///\/</>/?/*&]+$/...But in this it is also negating the alphabets.Also I have tried with opposite condition that in the String we should have alphabets and the expression is:-- ([a-z]|[A-Z]|[0-9]|[ ]|[-]|[_])*..... Please can anyone help me on this.
Thanks in advanced to all.
Munirasorry but you are posting things back that do not make any sense
what do you mean with the below comment?
munira06 wrote:
Yes you are correct ,but I have tried this with single special character
say
Re: RegExp for excluding special characters in a string.
here is a sample app taken from the live docs
using ^[a-zA-Z0-9 \-_]*$ as the regex accepts all characters from a-z, A-Z, 0-9 - [space] and_
run the example tell me what regex you are using and what test strings fail when they should pass or pass when they should fail
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the RegExpValidator. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import mx.events.ValidationResultEvent;
import mx.validators.*;
// Write the results to the
private function handleResult(eventObj:ValidationResultEvent):void {
if (eventObj.type == ValidationResultEvent.VALID) {
// For valid events, the results Array contains
// RegExpValidationResult objects.
var xResult:RegExpValidationResult;
reResults.text = "";
for (var i:uint = 0; i < eventObj.results.length; i++) {
xResult = eventObj.results[i];
reResults.text=reResults.text + xResult.matchedIndex + " " + xResult.matchedString + "\n";
} else {
reResults.text = "";
]]>
</fx:Script>
<fx:Declarations>
<mx:RegExpValidator id="regExpV"
source="{regex_text}" property="text"
flags="g" expression="{regex.text}"
valid="handleResult(event)"
invalid="handleResult(event)"
trigger="{myButton}"
triggerEvent="click"/>
</fx:Declarations>
<s:Panel title="RegExpValidator Example"
width="75%" height="75%"
horizontalCenter="0" verticalCenter="0">
<s:VGroup left="10" right="10" top="10" bottom="10">
<s:Label width="100%" text="Instructions:"/>
<s:Label width="100%" text="1. Enter text to search. By default, enter a string containing the letters ABC in sequence followed by any digit."/>
<s:Label width="100%" text="2. Enter the regular expression. By default, enter ABC\d."/>
<s:Label width="100%" text="3. Click the Button control to trigger the validation."/>
<s:Label width="100%" text="4. The results show the index in the text where the matching pattern begins, and the matching pattern. "/>
<mx:Form>
<mx:FormItem label="Enter text:">
<s:TextInput id="regex_text" text="xxxxABC4xxx" width="100%"/>
</mx:FormItem>
<mx:FormItem label="Enter regular expression:">
<s:TextInput id="regex" text="ABC\d" width="100%"/>
</mx:FormItem>
<mx:FormItem label="Results:">
<s:TextInput id="reResults" width="100%"/>
</mx:FormItem>
<mx:FormItem >
<s:Button id="myButton" label="Validate"/>
</mx:FormItem>
</mx:Form>
</s:VGroup>
</s:Panel>
</s:Application> -
How to print Special Characters in Sap-Scripts
How to print Special Characters in Sap-Scripts
Thanks,
RaviHi
if u want print special characters we can use hot codes i.e ' ' (single inverted commas). in between these hot codes insert u r special characters.
write ' !@#$%^&*( ) '.
for the above write statement output is
output is !@#$%^&*( ) -
How to write special characters in PDF using iText
How to write special characters encoded with UTF-8 in PDF using iText.
Regards,
Pandharinath.I don't know what your problem is but that's almost certainly the wrong question to ask about it. Java (including iText) uses only Unicode characters. (You may consider some of them to be "special" if you like but Unicode doesn't.) And when it does that, they aren't encoded in UTF-8 or any other encoding.
So can you describe your problem? That question doesn't make sense. -
How to display special characters in Script...
hi all,
Can any one tell me how to display special characters in script...
how to write in text element
thanks in advance,
prashantHi Prashant ,
What special characters would you like to include .
There are a set of characters / icons /symbols that can be included in Script , for that open a window in edit mode and in the menu there will be an option called Insert , here you can find a lot of characters/symbols that can be included .
Regards,
Arun -
Need help in replacing special characters in a string
Hi,
please let me know the best way to replace all the special characters in a string with space.
other than alphabets and numbers
with regards.
sumanth.please let me know the best way to replace all the special characters in a string with space.
other than alphabets and numbers
>
Sumanth Nag Kristam wrote:
> actually i need to replace hexa decimal char 0X1A in a string.... that is 'substitue' as per the chart
> any pointers....
>
> chk the link for the ASCII codes
> http://www.techonthenet.com/ascii/chart.php
But in Hexa decimal value there is no special characters? -
Sample code to identify special characters in a string
Hi,
I need to identify special characters in a string.... could anybody send me some code please.......
Thanks,
Best regards,
Karendata: str(100) type c.
data: str_n type string.
data: str_c type string.
data: len type i.
data: ofst type i.
str = '#ABCD%'.
len = strlen( str ).
do.
if ofst = len.
exit.
endif.
if str+ofst(1) co sy-abcde.
concatenate str_c str+ofst(1) into str_c.
else.
concatenate str_n str+ofst(1) into str_n.
endif.
ofst = ofst + 1.
enddo.
write:/ str.
write:/ str_c.
write:/ 'spacial chracter',20 str_n.
Function module <b>SF_SPECIALCHAR_DELETE</b> <b>DX_SEARCH_STRING</b>
l_address1 = i_adrc-street.
CHECK NOT L_ADDRESS1 IS INITIAL.
len = STRLEN( l_address1 ).
do len times.
if not l_address1+l(1) ca
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 '.
if i_adrc-street+l(1) CO sy-abcde.
elseif i_adrc-street+l(1) CO L_NUMCHAR.
exit.
endif.
l = l + 1.
enddo.
data : spchar(40) type c value '~!@#$$%^&()?...'etc.
data :gv_char .
data:inp(20) type c.
take the string length .
len = strlen (i/p).
do len times
MOVE FNAME+T(1) TO GV_CHAR.
IF gv_char CA spchar.
MOVE fnameT(1) TO inp2T(1).
ENDIF.
T = T + 1.
enddo.
REPORT ZEX4 .
PARAMETERS: fname LIKE rlgrap-filename .
DATA: len TYPE i,
T TYPE I VALUE 0,
inp(20) TYPE C,
inp1(20) type c,
inp2(20) type c,
inp3(20) type c.
DATA :gv_char.
data : spchar(20) type c value '#$%^&*()_+`~'.
START-OF-SELECTION.
CONDENSE fname.
len = strlen( fname ).
WRITE:/ len.
DO len TIMES.
MOVE FNAME+T(1) TO GV_CHAR.
IF gv_char ca spchar.
MOVE fnameT(1) TO inpT(1).
ENDIF.
T = T + 1.
ENDDO.
CONDENSE INP.
write:/ 'Special Characters :', inp.
Rewards if useful..........
Minal -
How to search special character in searchable PDF Document???
Hi All,
Could some one help me out, how to search special character in PDF document? I have attached the screen shot for your reference.
-Rgds,
GnanasekaranOK, I found it myself:
1. Tools - Pages - Edit Page Design - Header & Footer - Add Header & Footer.
2. Select the font and size, etc, place the cursor on the appropriate site to insert the page number, click the "Insert Page Number" button, and click OK.
That is! -
How to remove special characters while typing data in edit cell in datagrid in flex4
Hi Friends,
I am facing this problem "how to remove special characters while typing data in edit cell in datagrid in flex4".If know anyone please help in this
Thanks,
Anderson.Removes any characters from
@myString that do not meet the
provided criteria.
CREATE FUNCTION dbo.GetCharacters(@myString varchar(500), @validChars varchar(100))
RETURNS varchar(500) AS
BEGIN
While @myString like '%[^' + @validChars + ']%'
Select @myString = replace(@myString,substring(@myString,patindex('%[^' + @validChars + ']%',@myString),1),'')
Return @myString
END
Go
Declare @testStr varchar(1000),
@i int
Set @i = 1
while @i < 255
Select
@TestStr = isnull(@TestStr,'') + isnull(char(@i),''),
@i = @i + 1
Select @TestStr
Select dbo.GetCharacters(@TestStr,'a-z')
Select dbo.GetCharacters(@TestStr,'0-9')
Select dbo.GetCharacters(@TestStr,'0-9a-z')
Select dbo.GetCharacters(@TestStr,'02468bferlki')
perfect soluction -
How to Avoid Special Characters in string
Hai.
I want only Alphabets & Digits to be entered in to my string.No any other special characters except spaces.How can I do this?
Solved!
Go to Solution.MikeS81 wrote:
see the attached example.
I would allow a few more, e.g. 0 and 8 to allow editing of the entered string (backspace, cursor buttons, delete key, etc.).
Message Edited by altenbach on 11-21-2008 12:49 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
check_char_LV80MOD.vi 14 KB
FilterStringInput.gif 6 KB -
How to replace special characters in string.
Hello,
I want to replace special characters such as , or ; with any other character or " ".I find out there is no such function is java for this.There is only replace() but it accepts only chars.If anybody know how to do this?.
Thanks,Hello,
I want to replace special characters such as , or ;
with any other character or " ".I find out there is no
such function is java for this.There is only replace()
but it accepts only chars.If anybody know how to do
this?.
Thanks,Can't you just do the following?
public class Test
public static void main(String[] args)
String testString = "Hi, there?";
System.out.println(testString.replace(',',' '));
} -
How can I find special characters in a string
Hi,
I have a small task where I have to find special characters in a given string, Can anyone suggest.......................What is your definition of a "special character", could you be a bit more specific?
Do you simply want to find the position of a specific character in the string?
Can it occur more than once and you want to find all occurences?
What should happen if the special character does not exist?
For programming purposes, all 256 possible 8 bit characters (x00-xFF) can be treated the same. Non-printing characters can be entered in \-codes or hex display if needed.
LabVIEW Champion . Do more with less code and in less time . -
How to replace string containing special characters by another string
Hi all,
I have to Search for a pattern and replace it by a substitute pattern [Eg: Replace methodOrig (a,b) with SessTime = getSessionParameter(time); methodNew(a,b,SessTime) ] in files.
i tried this using replace(),but it din't work since string1 contains special characters.
can anyone help me asap.
thanks in advance.Double-post: http://forum.java.sun.com/thread.jspa?threadID=599211&tstart=0
-
How to convert special characters like #, &, etc occuring in the input string
Hi,
I am using method 'Get' to submit a form . When ever there is any
special character like '#' in my input For example "033#Test", nothing
gets posted beyond 033.
Can any one please let me know how do I overcome this problem.
Thanks in advance.
Regards,
Moin
Moinuddin:
It seems possible your browser may be confused by the fact that 033 is
the octal representation for an ESCape character (Hex 1B). Try dropping
the leading zero. In addition, it is usually better to represent special
characters like the hash mark "#" using HTML character entities instead
of literals, i.e. # = hash mark
Regards,
Jim Brown
Moinuddin Ahmed wrote:
>
> Hi,
> I am using method 'Get' to submit a form . When ever there is any
> special character like '#' in my input For example "033#Test", nothing
> gets posted beyond 033.
>
> Can any one please let me know how do I overcome this problem.
>
> Thanks in advance.
> Regards,
> Moin
Jim Brown
Developer Relations Engineer
BEA Support
-
How do you removing special characters from a string
hi,
i'm a novice to java, if you couldn't tell. i need to write a program to recognise palindromes (eg. madam etc.) but i can't work out how to strip or clean the input string of white space or punctuation. any help appreciated. by the way, any other ideas on how to go about it?? (i don't expect it to be done, just after guidance)
my thanks in advanceOK Here you are:
protected static String removeJunk(String string)
int i, len = string.length();
StringBuffer dest = new StringBuffer(len);
char c;
for (i = (len - 1); i >= 0; i--)
c = string.charAt(i);
if (Character.isLetterOrDigit(c))
dest.append(c);
return dest.toString();
Klint
Maybe you are looking for
-
plzz help me
-
Can not send e-mail in mac os x 10.4.11
can not send e-mail in mac os x 10.4.11
-
Can I change the posting date in CO13 to cancel a confirmation?
Hi all I'd like to know how can I change the posting date using CO13. So I have a confirmation in date 30/6 for exemple, but I'd like to cancel it in posting date 1/7, but the systems takes the date of the original confirmation. Can I change it any w
-
Www as part of website address?
I have recently uploaded a website I created in iweb. It looks great, but I've discovered the address can't include www. If you try to access the site by entering "www.web.mac.com/myname/iWeb it tells you there is an error. Is this because I am curre
-
Mail application, Silverkeeper and Lacie Firewire external drive
I have the following set-up: G5 PPC iMac OS X (10.4.11) Lacie Firewire 250Gb external hard disk Silverkeeper 1.1.4 I have used this software many times and it has worked perfectly, flawlessly even, EXCEPT for one issue. When I am at home I back up my