regular expression

Post your bug reports here.
Post Reply
dataminer
Posts: 5
Joined: Wed Feb 14, 2007 2:35 pm

regular expression

Post by dataminer »

I might be wrong, thinking this is a bug... tried 3.86 and 4.0beta

Can someone help me with regular expressions?

I am translating a subtitle file that looks like this:

1
00:08:35,295 --> 00:08:38,162
Piano, pianissimo...

2
00:08:38,731 --> 00:08:41,393
...senza parlar...

3
00:08:42,101 --> 00:08:43,568
...tutti con me...

4
00:08:45,238 --> 00:08:47,706
...venite qua

In the other window I have my translation of the text lines. I add empty lines in place of the time information. Once I am ready with my translation I want to compare and copy all time information into my translation file.

For that I need a regular expression that skips all text lines, and triggers the compare only on the lines that I here represent like this:
d
dd:dd:dd,ddd --> dd:dd:dd,dd

But how?

I created a rule 'Alphanumeric'
R1 string is ^[\&w ]
Set to ignore strings with match, all the rest empty, but this fails. (By the way, why \&w and not \w?)

To test I created another rule 'digits'
R1 string is ^\d
Set to ignore strings with match, all the rest empty, but it fails.

A bug or my mistake?

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

Try using this:
R1:^\d.*
Action: Ignore lines not matching R1

This will ignore all lines starting with non-digit. Note that most rules are about lines matching, not substriung search, so ending .* is required if you are filtering by line beginning.

dataminer
Posts: 5
Joined: Wed Feb 14, 2007 2:35 pm

Post by dataminer »

Thanks, unfortunately does not work as I want it to do.

I now see that in the section that I have not yet advanced in it is working. But there the target window is empty. Where both files contain data it is not, as if it is treated like one big block. Any idea?

dataminer
Posts: 5
Joined: Wed Feb 14, 2007 2:35 pm

Post by dataminer »

Wait! Something improved. I set 'Min String length to match' to 0. Now it is working nicely, but the placement of the translation strings is incorrect.

As I have to many empty lines in my translation file (I wrote: I add empty lines in place of the time information.) The time strings are set to be inserted in my translation, not to overwrite the empty lines that I inserted!

Switching 'Ignore inserted empty lines' does not result in any difference. Still I would like to have it overwrite/replace the empty strings instead of inserting them. Help is appriciated!

dataminer
Posts: 5
Joined: Wed Feb 14, 2007 2:35 pm

Post by dataminer »

A question came up:

I have disabled Use line compare. Why do some lines show up as 'Sam (in-line)' while actually all should be recosnised as 'Changed'?

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

If you could send me to support@grigsoft.com parts of your actual files and examples of what you have and what you want to achieve, I could help you in more details.

Youb are right with colors usage if Lines comparison is off. I will fix that.

Post Reply