It is currently March 28th, 2024, 8:20 am
Regular expressions question
Regular expressions question
Hi guys, my question may sound a bit silly but Im new to regular expressions. I understand the working of the expression itself, but my question is about the (?siU) part. I know what ?siU means, but are there another commands that I can use there? I've seen commands such as RegExp="(\r\n|\n), but I don't know what it does. Is there a tutorial that covers this part of the commands (the parenthesis part)? I've browsed around, but found nothing. If anyone could help, I'd appreciate it!
Re: Regular expressions question
Actually I did, but it still doesn't explain about the regexp(????) part. My guess is that those are commands to the regex parser, but where do I find those commands?
-
- Developer
- Posts: 1270
- Joined: April 3rd, 2009, 4:31 am
- Location: NC, US
Re: Regular expressions question
http://www.sdsc.edu/~moreland/courses/IntroPerl/docs/manual/pod/perlre.html
http://www.regular-expressions.info/quickstart.html
Some places to look, the perl docs in particular as that is the RE that Rainmeter uses.
http://www.regular-expressions.info/quickstart.html
Some places to look, the perl docs in particular as that is the RE that Rainmeter uses.
Re: Regular expressions question
Thank you guys, I found what I was looking for in this page: http://www.sdsc.edu/~moreland/courses/I ... erlre.html
Re: Regular expressions question
Yes it does.ehcelino wrote:Actually I did, but it still doesn't explain about the regexp(????) part. My guess is that those are commands to the regex parser, but where do I find those commands?
What is this ?siU stuff?
The "?s" tells RegExp to ignore "line breaks" when doing a search. That way if you search for "Every good boy deserves favor" and it is split on two lines in the output, it will still match.
The "i" tells the search to be "case insensitive". Matches will work on both upper and lower case.
The "U" tells RegExp to be "ungreedy", meaning that it will return only the first instance of the match on the search string.