On Sat, 29 Nov 2008 21:19:01 -0500 [EMAIL PROTECTED] ("Chas. Owens") wrote:
> The most power comes from using Perl's variant of regexes. Since > other languages don't implement those extensions, and you are planning > on using a language other than Perl, you are wasting your time here. I know Perl and I was planning to "get the logic" from the answer and apply it to the language I'll use. Since the question I was asking is pretty simple (there is almost no script without bbcode nowadays) it would be easy to adapt the solution. But since you are not trying to help but trying to complicate things it was not possible, so far. > And yes, asking about what variables are on a different languages list > is foolish. For instance, Perl's variables are dynamic and loosely > typed, whereas Pascals are static and strongly typed. If you asked > here about variables and then tried to use what you were told in > Pascal you would wonder why none of your code even compiled. You see? You just complicate things. I just want to learn what a variable is. "It is that simple". But you try to teach me what dynamic or loosely variables are (You even use the word itself inside the your definition). And this is the exact problem we are having here, with my question. > > Sadly, this is what many people think. It isn't that easy. What if > the code looks like this > > <p><img src="end_p_tag.jpg" alt="</p>"></p> > > Now you have to understand image tags and paragraph tags, there are > countless other examples. The cavalier "I'll just through some regex > at it" attitude is why we have things like XSS and injection attacks. > 1) How can I make you understand, there won't be any attributes or img tags or javascript etc. Please stop giving examples of HTML structures, 2) It won't look like that because _I_ will enter the input, 3) Since I won't use this as a serious application it doesn't matter whether it is secure or not. 4) You are still talking like I want to parse HTML files, completely. NO. My problem is different, I just used HTML for this mailing list to understand the problem, easily. In other words it was just a demonstration. > I understand what you are asking for and I am trying to tell you that > you are looking in the wrong place (both on this list and in regard to > using a regex for this problem). You insist not to understand my problem. I just want to match <p><p></p></p> properly that's it. No attributes, no img tag, no XML, no XSS attack, no javascript, no fancy characters. I don't want to write a browser for christ's sake. And I just want to learn how can this structure be written in regular expressions. I don't want to use a module, I want to improve my knowledge of regular expressions. If it will help, I change my example. How can I match structures like this: [block] this is a block [block] this is another block [/block] first block ends [/block] You see? No HTML. This is a language I invented it has just [block] and [/block] keywords, nothing else. Sure parsing is a good thing but it is not necessary for this problem and I want to do it in regexp way, wait a minute, wasn't that Perl's idiom: "There is more than one way to do it". Please don't continue the "you are doing it wrong way" thing, the discussion is already out of its way! If you don't know how to do this then please don't speak, if you do, please tell... -- Canol Gökel <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/