Dictionary regular expressions: address start of line with ^ ?

Forum for TextAloud version 3

Moderator: Jim Bretti

Post Reply
frimipiso
Posts: 10
Joined: Sat Apr 23, 2016 7:06 pm
Contact:

Dictionary regular expressions: address start of line with ^ ?

Post by frimipiso »

Hi,

I am a happy user of Textaloud now and I really like the regular expression functionality in the dictionary.

However, I don't know how to address the beginning of a line. I would like to find lines starting with an even or odd number.

If I use the "^" caret I only address the start of the file.

How can I address the start of a line?

Thanks,

Jens
Jim Bretti
Posts: 1558
Joined: Wed Oct 29, 2003 11:07 am
Contact:

Re: Dictionary regular expressions: address start of line with ^ ?

Post by Jim Bretti »

There is an option, (?m) you can use in your regular expression to turn on multiline mode. Use it like this:

(?m)^abc

This expression should match any line starting with abc.

By default ^ matches the beginning of the string being searched, and $ matches the end. In multiline mode, ^ matches the beginning of a line, and $ matches the end of a line.
Jim Bretti
NextUp.com
frimipiso
Posts: 10
Joined: Sat Apr 23, 2016 7:06 pm
Contact:

Re: Dictionary regular expressions: address start of line with ^ ?

Post by frimipiso »

Cool. Thanks,

Jens
Post Reply