24112RE: RE: [Clip] REGEX Search Backward
- Nov 1, 2013
There are no dumb questions - if one doesn't know, they don't know. The (?s) tells regex to ignore line ends. Regular replaces reach only to the end of the line, but if you want something in the middle of the file, you are clearly going to have to accept line ends, thus you start the line with (?s). Be careful with this, or you will be changing things far from what you intend to change.
I'm new(ish) to this group and have a question about your post - the (?s)\A is something that I have been looking for for a while (as a way to identify the beginning of the file). Could you explain to me what the (?s) does? I tried this as straight \A and it doesn't work so clearly the (?s) is necessary.
Sorry if this seems a dumb question
One way to do that is to start your search with (?s)\A, which is the beginning of the document. Then, the item you are looking for, then the last item that you are looking 'backwards' from. This is still a search down, only you have anchored it to start at the beginning of the doc and search down to your final term.
I am new to REGEX searchs.
I attempted a REGEX search backwards in an outline topic for any URL, but got a 'could not find, start at the beginning' standard message. The search works great forward. The outline topic has many URLs in it.
Is this an issue with REGEX? Any ideas?
- << Previous post in topic Next post in topic >>