# Regex in a Text File type

I'm trying to set up a Text File Type. In the file, lines starting with the character '!' are comment lines that must be excluded from the translation.

Example line that must not be translated:

! Note: Do Not Use "". Line will be cut.

The only option I seem to have is to define an Inline Tag that will set up " lines starting with the character '!' " as a placeholder.

I've tried various regexp, but none seem to work. The most basic one is:

^!.+\$

I've also tried !.+ and a few others, but my lines starting with ! keep showing up as translatable. This may have to do with ! being a special character. But escaping the ! has no effect either: ^\!.+\$

## Top Replies

• So how do I get segmentation by line instead of by sentence?

As I said above, you can use paragraph segmentation.  This is probably the best approach given…

• In fact with one small change to your filetype rule because of the ! on its own:

^!.*\$

You'll get this:

So quite simple in the end.