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 8384055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:18:54+00:00 2026-06-09T17:18:54+00:00

I wanted to use regular expressions in eclipse to adept code to a software

  • 0

I wanted to use regular expressions in eclipse to adept code to a software update.

instead of

{$CFG->prefix}example1.xy

the code needs to be:

{example1}.xy

to work.

another example would be:

{$CFG->prefix}example2.foo

>

{example2}.foo

constant parts are : {$CFG->prefix}; .

i tried the following (i used whitespaces to make reading easier):

Find: \{\$CFG-\>prefix\} ([a-z]|[0-9])* \. ([a-z]|[0-9])*

Which will find the requested String. I struggle in replacing it.

i can use ,/1to store the result of the regex and use it in the replacement (right?) but i am not sure how i can modify/manipulate this result.

thanks for any help.

  • 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-09T17:18:55+00:00Added an answer on June 9, 2026 at 5:18 pm

    Try the following search and replace :

    Find: \{\$CFG->prefix\}([a-z0-9]*)\.([a-z0-9]*)

    Replace with : {\1}.\2

    Using the above the following :

    Before     BECOMES     After

    Here is a quick screen-cast to show this in action.

    Changes made to the OP’s Find reg-ex

    In order to get the above find-replace to work, I had to make the following changes to the OP’s find expression :

    1. Removed whitespaces.
    2. Moved the Greedy Match modifier inside the groups : i.e. ([...]*) instead of ([...])*
    3. Corrected the character set : i.e [a-z0-9] instead of [a-z]|[0-9]
    4. Introduced another Group which captures the part after the period. This however is not strictly needed but may be useful in some scenarios.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're using a proprietary tracking system that requires the use of regular expressions to
I need to validate serial numbers. For this we use regular expressions in C#,
I am trying to use regular expressions to parse a method in the following
First, I confess I'm not realy experimented with regular expressions. I know how use
I know I cannot use regular expressions for the url-pattern of a filter-mapping, but
I wanted to use 6 different textures on a cube, one per side, but
I wanted to use full import names in my project (see this question ).
I wanted to use winreg module of python for working with windows registry. But
I wanted to use full width stripe on my footer, but aparently it doesen't
I wanted to use a 'switch' with String, which is supported only in compiler

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.