It is currently March 28th, 2024, 8:20 am

Regular expressions question

Get help with creating, editing & fixing problems with skins
Post Reply
ehcelino
Posts: 7
Joined: May 6th, 2010, 1:20 am

Regular expressions question

Post by ehcelino »

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!
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm
Contact:

Re: Regular expressions question

Post by poiru »

ehcelino
Posts: 7
Joined: May 6th, 2010, 1:20 am

Re: Regular expressions question

Post by ehcelino »

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?
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Regular expressions question

Post by dragonmage »

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.
ehcelino
Posts: 7
Joined: May 6th, 2010, 1:20 am

Re: Regular expressions question

Post by ehcelino »

Thank you guys, I found what I was looking for in this page: http://www.sdsc.edu/~moreland/courses/I ... erlre.html

:-)
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm
Contact:

Re: Regular expressions question

Post by poiru »

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?
Yes it does.
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.
Post Reply