Start a new topic

Regex question(s)

Hi everyone (especially Igor),

I have:

src: De prijs verschuldigd door <Bedrijf X> aan <Opdrachtnemer>

trgt: The price payable by <Company X> to <Contractor> for

My attempted regexes:

De prijs verschuldigd door .+? aan .+? [TAB] The price payable by XXX to XXX

De prijs verschuldigd door .+? aan \w+ [TAB] The price payable by XXX to XXX

Neither of these work.

Related question: what is the best way to handle stuff like "<Opdrachtnemer>" in my src text?

I have been adding them like this:

|.?Opdrachtnemer.? [TAB] <Contractor>


PS: I think it would be a good idea to have a separate subforum just for regexes. What do you think?

PPS: It's a pity you can only use one font in your posts!

1 person likes this idea

Hi Michael,

Does the below work?

De prijs verschuldigd door (.*)? aan (.*)? [TAB] The price payable by XXX to XXX

A separate forum for regex would be very nice!



Strange. It works in the sense that it shows up in the F2 list (and in my glossary pane), but it doesn't seem to get auto-assembled. That is, it's not showing up via F1.

What does the (.*)? stand for?

I think maybe those angle brackets in my text are causing problems.

Hi Michael,

(.*) means zero or more characters, unlike (\w+) which means a word with any characters.

A ? indicates that it is optional.

I'm not sure why it does not show via F1, though, as I generally use glossary pane and F2.


Hi Michael,

F2 display is HTML based, That is why <Opdrachtnemer> is hidden.


Hmm, so what's the difference between using:

.?         (= Any character, once, or not at all.)

(.*)?    (= Zero or more characters, once, or not at all.) 

This stuff makes my brain hurt ;)


Please correct me if I'm wrong. :D

.? will match a character or none.

For example, .?at will match at, cat, hat, but not chat

But .*?at will match at, cat, hat, and also chat, etc.


Oh, it also seems to me that .*?at will match 

catch a cat

This is entirely my guess, though :)

Login to post a comment