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

  • Home
  • SEARCH
  • 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 8607271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:18:42+00:00 2026-06-12T03:18:42+00:00

Hi I would really appreciate some help in forming a regex that removes a

  • 0

Hi I would really appreciate some help in forming a regex that removes a percentage from the end of a string:

Film name (2009) 58%  ->  Film name (2009)
Film name (2010) 59%  ->  Film name (2010)

The string may or may not have the bracketed year. Before the bracketed year, the film name may be alphanumeric and have multiple words.

I am using ‘bulk rename utility’ so am looking to fill in the ‘match’ and ‘replace’ fields.

The best I could come up with was:

([A-Z][a-z]*) \((\d*)\) (\d*\%) -->  \1 (\2)

though this only seemed to work with single word film names, and lost the brackets so I had to re-add!

I’ve google and every time I try possible expressions it doesn’t work in the ‘bulk rename utility’ which I believe is based on pcre (Bulk Rename Utility).

  • 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-06-12T03:18:44+00:00Added an answer on June 12, 2026 at 3:18 am

    To avoid replacing the wrong things do this

    \b(100|\d{1,2})%\b
    

    and replace it with nothing.

    It stops at word boundaries (ie 30% is ok but w30% is not) and gets only 100 or 0-99 numbers.

    EDIT:

    If the % is the last char of the string you can achieve a better result in doing

    \b(100|\d{1,2})%$
    

    this way you get only the % at the end of the line avoiding to remove numbers with % from the title of the film.

    If the string is a filename and you need to replace it and you can’t just remove a part of the tile you can do this

    (.+?)(100|[0-9]{1,2})%$ #I think using 0-9 is accepted by more languages
    

    and replace with

    $1
    

    \1 and \2 should not be used in a replacement expression. They are regex patterns that match what the first and second capture matched. $1 and $2 are variables that contain what the first and second capture matched, so you should use those instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would really appreciate some help with deleting a file from IsolatedStorage on WP7.
I'm at a lose end and would really appreciate some help as it is
I would really appreciate it if some of you could help optimize my tables,
Would really appreciate some help with a search angine I'm trying to make for
I would really appreciate some help with my problem: I have 2 MySQL tables,
I am new to Ruby and would really appreciate some help understanding what is
I'm fairly new to SQL Server and would really appreciate some help with this.
I'm totally stumped on this error. Would really appreciate some help :). To reproduce
Ok, im pretty new at this and I would really appreciate some help, thanks!
Would really appreciate some help with this. I have an app which consists of

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.