Try this:

(C\d{3})([A-RT-Z\d]+)?(S[\d\-_]+)?(?:_\d+)

Result: https://regex101.com/r/FETn0U/1

Answer from Avinash on Stack Overflow
๐ŸŒ
Quora
quora.com โ€บ How-do-I-check-if-a-string-contains-multiple-values-in-Python
How to check if a string contains multiple values in Python - Quora
Quora is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers.
๐ŸŒ
Net Informations
net-informations.com โ€บ python โ€บ basics โ€บ multiple.htm
Check if multiple strings exist in another string : Python
The "in" operator is simple and straightforward for basic checks, while regular expressions offer greater flexibility for advanced pattern matching involving more complex substrings. Custom functions provide modularity and code reusability for repetitive substring checks. Choose the most suitable method based on your requirements to efficiently determine if multiple strings exist in another string in Python.
Discussions

Regex: Help to find multiple values in string (Python) - Stack Overflow
I need to extract 3 different details out of 1 string. The pattern is: "C" followed by 3 digits. Character and number of any kind. However, an order of one/two character(s) followed by a More on stackoverflow.com
๐ŸŒ stackoverflow.com
May 5, 2022
python - How to extract multiple values from a string - Stack Overflow
I have a long Python list like: ['A p=45 n=200 SNR=12', 'B p=2232 n=22 SNR=2'] I would like to get from this list a list of tuples containing the value of p, n and SNR. So: funz(['A p=45 n=200 ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - How do I store multiple strings as one variable - Stack Overflow
I have the write a if and else statement for every supposed user using my code in order to make sure they are who they are. I am wondering if there is a more efficient way to do that. What I want the More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - Check if multiple strings exist in another string - Stack Overflow
How can I check if any of the strings in an array exists in another string? For example: a = ['a', 'b', 'c'] s = "a123" if a in s: print("some of the strings found in s") el... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Codecademy Forums
discuss.codecademy.com โ€บ frequently asked questions โ€บ python faq
How do I insert multiple variables with string formatting? - Python FAQ - Codecademy Forums
June 18, 2018 - Question How do I insert multiple variables with string formatting? Answer So long as your number of %s placeholders matches the number of variables you are providing after the %, it will insert them in the order in which you provide them.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_variables_multiple.asp
Python Variables - Assign Multiple Values
Remove List Duplicates Reverse a String Add Two Numbers ยท Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Training ... Note: Make sure the number of variables matches the number of values, or else you will get an error. And you can assign the same value to multiple variables in one line:
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ python-check-if-multiple-strings-exist-in-another-string
Check if multiple Strings exist in another String in Python | bobbyhadz
April 9, 2024 - You can use the assignment expression syntax if you need to get the value that is contained in the string. ... Copied!my_str = 'apple, egg, avocado' list_of_strings = ['apple', 'banana', 'kiwi'] if any((match := substring) in my_str for substring in list_of_strings): # ๐Ÿ‘‡๏ธ this runs print('At least one of the multiple strings exists in the string') print(match) # ๐Ÿ‘‰๏ธ 'apple' else: print('None of the multiple strings exist in the string')
Find elsewhere
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 74842998 โ€บ how-to-assign-multiple-string-values-to-a-variable-in-python
how to assign multiple string values to a variable in python - Stack Overflow
User_Name = "Allex_Benzz", "allex benzz", "allex_benzz", "Allex Benzz" User_Input = input("Please Input Your User Name...!\n") if User_Input == User_Name: # ... User_Name is a tuple of multiple strings, and User_Input is a single string. A single string will never be equal to (==) a tuple, but it can be in a tuple.
๐ŸŒ
Data Science for Everyone
matthew-brett.github.io โ€บ teaching โ€บ string_formatting.html
Inserting values into strings โ€” Tutorials on imaging, computing and mathematics
You can use the string method format method to create new strings with inserted values. This method works for all current releases of Python.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ gloss_python_multi_line_strings.asp
Python Multiline Strings
Python HOME Python Intro Python Get Started Python Syntax ... Python Variables Variable Names Assign Multiple Values Output Variables Global Variables Variable Exercises Code Challenge Python Data Types ... Python Strings Slicing Strings Modify Strings Concatenate Strings Format Strings Escape ...
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 75036562 โ€บ multiple-strings-in-one-variable
python - Multiple strings in one variable - Stack Overflow
How would this problem be fixed so that I could place multiple possible strings in a variable so that one of the strings in the variable would be recognized later in the program? ... you tagged this "basic" but it looks like python, and that is not how the boolean operators work. in both cases you're setting target_letter to the single value that passes the boolean tests, not a set of values as you seem to be wanting
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ How-to-check-if-multiple-strings-exist-in-another-string-in-Python
How to check if multiple strings exist in another string in Python?
For example, checking the multiple strings: "TP", "WELCOME", exists in the string "WELCOME to TP". For achieving this, Python provides different methods including loops, any() and all().
๐ŸŒ
Note.nkmk.me
note.nkmk.me โ€บ home โ€บ python
Multiple Assignment in Python | note.nkmk.me
May 6, 2023 - ... You can assign multiple values to multiple variables by separating them with commas ,. ... You can assign values to more than three variables, and it is also possible to assign values of different data types to those variables. a, b, c = ...
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ is there an easy way to pass an entire list, or multiple values inside string.format()?
r/learnpython on Reddit: Is there an easy way to pass an entire list, or multiple values inside STRING.format()?
July 18, 2022 -

Hey there folks I wrote a small script with PRAW to post a list of top 10 users with highest karma within a subreddit.

I have a function that fetches the data from my DB, it returns a list of 10 tuples with 2 values, so something like this [(user, karma), (user1, karma1) ... ].

Normally I would just iterate over it and display the data in a print statement, however this time I need to "submit" all the values at once as a whole inside a table.

This table:

snippet 1
    REPLY_TEXT="""-|user|+karma
    :-:|:-:|:-:
    1|{}|{}
    2|{}|{}
    3|{}|{}
    4|{}|{}
    5|{}|{}
    6|{}|{}
    7|{}|{}
    8|{}|{}
    9|{}|{}
    10|{}|{}"""


snippet 2
    result_list = my_list_from_db()


    reddit.subreddit("test").submit(title="This is a title",  selftext=REPLY_TEXT.format(result_list[0][0], result_list[0][1], result_list[1][0], result_list[1][1], result_list[2][0], result_list[2][1], result_list[3][0], result_list[3][1], result_list[4][0], result_list[4][1], result_list[5][0], result_list[5][1], result_list[6][0], result_list[6][1], result_list[7][0], result_list[7][1], result_list[8][0], result_list[8][1], result_list[9][0], result_list[9][1]))

This works but is tedious to write and doesn't look good, how can I improve this? Can I loop through the list inside the .format() or a more efficient way to pass a lot of values all in once?

๐ŸŒ
Real Python
realpython.com โ€บ lessons โ€บ dealing-with-multiple-values
Dealing With Multiple Values (Video) โ€“ Real Python
00:55 One way of distinguishing multiple values is to separate them with a character like a comma. With that, you can use strings .split() method to chop a string up into pieces based on that character.
Published ย  December 23, 2025
๐ŸŒ
Python Guides
pythonguides.com โ€บ create-a-string-with-variables-in-python
Ways to Insert a Python Variable into a String
February 2, 2026 - I love this method because I can even do math right inside the braces. The :,.2f part ensures the price looks professional with a comma and two decimal places. Before f-strings came along, the .format() method was my go-to. I still use it today when I need to reuse the same variable multiple times in a long paragraph.