Hướng dẫn how do i find special characters in python? - làm cách nào để tìm các ký tự đặc biệt trong python?

Tôi đang tạo ra một bộ trong Python để chứa tất cả các biểu tượng trên bàn phím của tôi, nhưng rõ ràng là một vài vấn đề. Có cách nào để đưa tất cả chúng vào đó mà không gặp vấn đề gì không?

Đây là bộ của tôi:

symbols = {`,~,!,@,#,$,%,^,&,*,(,),_,-,+,=,{,[,},},|,\,:,;,",',<,,,>,.,?,/}

Để khắc phục nhận xét hầu hết, vì trong Python # là để bình luận, tôi đã bao gồm mọi thứ như vậy:

symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}

Điều này hoạt động cho nhân vật đó, nhưng bây giờ tôi đã có thể thấy một vấn đề khi tôi bắt gặp '\. Có cách nào tốt hơn để thực hiện bộ này không?

symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
38
symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
50#6
String is not accepted.
4
symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
53

symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
6
Input : Geeks$For$Geeks
Output : String is not accepted.

Input : Geeks For Geeks
Output : String is accepted
1
symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
58

symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
6
Input : Geeks$For$Geeks
Output : String is not accepted.

Input : Geeks For Geeks
Output : String is accepted
4
symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
72
Input : Geeks$For$Geeks
Output : String is not accepted.

Input : Geeks For Geeks
Output : String is accepted
6

  • String is not accepted.
    3
  • symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    96#3#7
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    99
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    00
  • symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    50#6
    String is not accepted.
    4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    53

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    58

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    72
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    String is not accepted.
    3
    Examples : 
     

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    96#3#7
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    99
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    00
    Make a regular expression(regex) object of all the special characters that we don’t want, then pass a string in search method. If any one character of string is matching with regex object then search method returns a match object otherwise return None.
    Below is the implementation : 
     

    C++

    #include

    #include

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    0
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    1
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    2

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    3
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    4

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    5

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    7
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    8
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    9

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    2

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    3
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    4
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    5
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    8

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    3
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    4
    String is not accepted.
    1
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    String is not accepted.
    3

    String is not accepted.
    4
    String is not accepted.
    5

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    5

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    String is not accepted.
    8
    String is not accepted.
    9
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    string is not accepted
    2

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    string is not accepted
    4
    string is not accepted
    5

    String is not accepted.
    3

    Python3

    string is not accepted
    7
    string is not accepted
    8

    string is not accepted
    9 #0

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6#22____53 #4#5#6#7#8

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1'1#3#3 '4'5

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    3'7#6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    5#8

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    8\3

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    3'7#6
    String is not accepted.
    1#8

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1 #include 0#3#3 #include 3 \3

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6#include 6#3
    String is not accepted.
    9

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6#include 0

    PHP

    #include 1

    #include 2 #include 3#include 4#8

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    5

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6#include 8 #include 9#7
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    01

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    02#include 4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    9

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1#6#include 8#8

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    3'7#6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    5
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    9

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    8

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    3'7#6
    String is not accepted.
    1
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    9

    String is not accepted.
    3

    #include 4

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    24
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    25
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    #include 3#include 4

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    9

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    30

    Đầu ra

    String is not accepted.

    Phương thức: & nbsp; để kiểm tra xem một ký tự đặc biệt có mặt trong một chuỗi nhất định hay không, trước tiên nhóm tất cả các ký tự đặc biệt là một tập hợp. Sau đó sử dụng cho vòng lặp và nếu các câu lệnh kiểm tra các ký tự đặc biệt. Nếu bất kỳ ký tự đặc biệt nào được tìm thấy thì hãy tăng giá trị của c. Cuối cùng, kiểm tra xem giá trị C có lớn hơn 0 hay không thì chuỗi in không được chấp nhận nếu không chuỗi in được chấp nhận. & NBSP;  To check if a special character is present in a given string or not, firstly group all special characters as one set. Then using for loop and if statements check for special characters. If any special character is found then increment the value of c. Finally, check if the c value is greater than zero then print string is not accepted otherwise print string is accepted. 

    C++

    #include

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    32

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    0
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    1
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    2

    String is not accepted.
    4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    37

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    39
    String is not accepted.
    9
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    String is not accepted.
    4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    44

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    46
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    47
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    48

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    50#6
    String is not accepted.
    4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    53

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    5

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    58

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    5

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    61
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    62

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    String is not accepted.
    3

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    String is not accepted.
    3

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    69

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    72
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    String is not accepted.
    3

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    8
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    5

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    4
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    81
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    6

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    38
    String is not accepted.
    3

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    string is not accepted
    4
    string is not accepted
    5

    String is not accepted.
    3

    Python3

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    89#3
    String is not accepted.
    9

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    92

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    93#3
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    95

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    96#3#7
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    99
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    00

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    50 ______202

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    10
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    03
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    12

    ________ 161 ________ 193 ________ 215 ________ 53 ________ 217 & nbsp; & nbsp;

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    1
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    19

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6'7#6
    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    72#8

    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    8\3

    symbols = {'`','~','!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','[','}','}','|','\',':',';','"',''','<',',','>','.','?','/'}
    
    6'7#6
    Input : Geeks$For$Geeks
    Output : String is not accepted.
    
    Input : Geeks For Geeks
    Output : String is accepted
    30#8

    Đầu ra

    string is not accepted


    Làm thế nào để bạn tìm kiếm các ký tự đặc biệt?

    Để tìm kiếm một ký tự đặc biệt có chức năng đặc biệt trong cú pháp truy vấn, bạn phải thoát khỏi ký tự đặc biệt bằng cách thêm dấu gạch chéo ngược trước đó, ví dụ: để tìm kiếm chuỗi ở đâu?ở đâu\?"escape the special character by adding a backslash before it, for example: To search for the string “where?”, escape the question mark as follows: “where\?”

    Làm thế nào để bạn kiểm tra xem có ký tự đặc biệt trong một chuỗi không?

    Để kiểm tra xem một chuỗi có chứa các ký tự đặc biệt không, hãy gọi phương thức Test () trên biểu thức chính quy phù hợp với bất kỳ ký tự đặc biệt nào.Phương thức kiểm tra sẽ trả về true nếu chuỗi chứa ít nhất 1 ký tự đặc biệt và sai.call the test() method on a regular expression that matches any special character. The test method will return true if the string contains at least 1 special character and false otherwise.