Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6828429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:22:54+00:00 2026-05-26T22:22:54+00:00

string = heLLo hOw are you toDay results = string.find([A-Z]) <—– Here is my

  • 0
string = "heLLo hOw are you toDay"
results = string.find("[A-Z]") <----- Here is my problem
string.lower().translate(table) <--- Just for the example.
>>>string
"olleh woh era uoy yadot"
#here i need to make the characters that where uppercase, be uppercase again at the same index number.
>>>string
"olLEh wOh era uoy yaDot"

i am need to find the index number of the uppercase characters in the string above, and get a list (or whatever) with the index numbers in order to use again on the string, to bring back the uppercased characters at the same index number.

maybe i can solve it the the re module, but i didn’t find it any option to give me back the index numbers.
hope it understandable, i have done a research but couldn’t find solution to it.
Thanks.

BTW, i am using python 3.X

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:22:55+00:00Added an answer on May 26, 2026 at 10:22 pm

    You can do something along this line, just need to modify it a little bit and collect those start positions into an array etc:

    import re
    
    s = "heLLo hOw are you toDay"
    pattern = re.compile("[A-Z]")
    start = -1
    while True:
        m = pattern.search(s, start + 1) 
        if m == None:
            break
        start = m.start()
        print(start)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I may have string like, Hello, %(name)s, how are you today, here is amount
Just a blackout, I want the String hello hallo tjena hej tere to an
For instance, I have the following string: Hello how are you today, [name]? How
hello I am new here and in programming as well. Today I have been
I have a string Hello hello (including the quotes) and i just want to
A table contains the string Hello world! Thinking of * as the ordinary wildcard
I have the following template String: Hello [Name] Please find attached [Invoice Number] which
I am trying to remove quotes from a string. Example: hello, how 'are you
I have a string like hello /world today/ I need to replace /world today/
Say I have a search string like: Hello [NAME], how are you today? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.