Looking at some of yanfly's regex
/<(?:REGION_BATTLEBACKS|region battlebacks)>/iI don't understand what the ?: is doing.Is there something special about it in the context of a capture group?
I'm also interested in knowing. I know that :? Would mean zero or one :, but I'm not sure about ?:
?: allows you to create match groups that capture matches without generating back-references. Basically, it's a performance optimization when you don't need access to all of the back-references that your regular expression creates -- just the most recent one.
It certainly can, depending on the string you're matching the regular expression against.
Is there a term for that notation?
Honestly, I don't know -- and I don't really see the importance of knowing the term if you know what you're doing with it, really.
Would be useful if you just want to detect if the string exists. So for things you're setting in notes as a flag but don't have any parameters, or for the purposes of that particular section of script, you don't care what the parameters are.
Yes, because of the /i at the end. That's got nothing to do with the ? at the start.
/<(?:REGION_BATTLEBACKS|region battlebacks)>/imeans we can write it as
<region_battlebacks>
or
<region battlebacks>
(one using space one using underscore)
so we could also use it as
/<(?:REGION_BATTLEBACKS|region battlebacks|rb|reg_battleb)>/iand we can use <rb> and <reg_battleb>
i think ?: is like "if either regexp inside the bracket match" it will grab the data.
(but it might also means just plain if and the | is the one making the or statement)
i have no actual knowledge about regexp. but it's based on experience on experimenting on regexp (combining victor, yanfly, tsukihime, mr bubble) to make my own notetags grabber script. i usually use trial and error and see what happen when we put that regexp. and i found above when seeing mr bubble script. in his notetags we can use item, armor, weapon or just i, a, w (for shorter notetags).
Since the original question has been answered ...
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.