Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Use capturing group next to literal #98

Description

@Masynchin

Proposed tag: question.

I want to make all class {Name}Test to be internal class {Name}Test, so I try to run:

ruplacer 'class (\w+)Test' 'internal class $1Test'

But it doesn't work as expected. I avoided it with

ruplacer 'class (\w+)(Test)' 'internal class $1$2'

But how can solve my issue without adding second capturing group?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions