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
Dictionary regular expressions: address start of line with ^ ?
Moderator: Jim Bretti
-
- Posts: 1558
- Joined: Wed Oct 29, 2003 11:07 am
- Contact:
Re: Dictionary regular expressions: address start of line with ^ ?
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.
(?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
NextUp.com
Re: Dictionary regular expressions: address start of line with ^ ?
Cool. Thanks,
Jens
Jens