#1 2025-06-05 11:16

Sequencer1
Member
Registered: 2025-06-02
Posts: 2

How do I rearrange only if there's an exact match?

Hi all,

I couldn't find a thread with this question, so apologises if it has been asked already.

I'm looking to rearrange specific numbers/text, only if it matches the input exactly and isn't part of a larger section.

Example:

Text 123.wav

to

123 Text.wav

I have somewhat achieved this already by using the rearrange function with the following settings:

Split using: "Exact pattern of delimiters"
Pattern: "|123"
New pattern: "123 $1$2"

However, it will also move the matched "123" even if it's part of a larger sequence/word.

Example:

Text 1234.wav

to

123 Text 4.wav

As you can see, it ends up rearranging the 123 away from the 4, which I don't want. The same applies to words.

So I'm trying to move text only if it isn't going to break a larger number sequence or word.

Thank you

Last edited by Sequencer1 (2025-06-05 11:54)

Offline

#2 2025-06-05 14:57

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,484

Re: How do I rearrange only if there's an exact match?

The Rearrange rule is not suitable for your task, but the Regular Expressions rule is.

Replace expression "(.*)\s+(123)\b" with "$2 $1".

Offline

#3 2025-06-05 15:43

Sequencer1
Member
Registered: 2025-06-02
Posts: 2

Re: How do I rearrange only if there's an exact match?

den4b wrote:

The Rearrange rule is not suitable for your task, but the Regular Expressions rule is.

Replace expression "(.*)\s+(123)\b" with "$2 $1".

Ah brilliant, yes that works.

Much appreciated and thanks for the response den4b

smile

Last edited by Sequencer1 (2025-06-05 15:44)

Offline

Board footer

Powered by FluxBB