regular expression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Asper Faner

    #1

    regular expression

    I seem to always have hard time understaing how this regular expression
    works, especially how on earth do people bring it up as part of
    computer programming language. Natural language processing seems not
    enough to explain by the way. Why no eliminate it ?

  • Paddy

    #2
    Re: regular expression


    Asper Faner wrote:
    I seem to always have hard time understaing how this regular expression
    works, especially how on earth do people bring it up as part of
    computer programming language. Natural language processing seems not
    enough to explain by the way. Why no eliminate it ?
    If you try to eliminate what you don't understand you won't learn
    anything!

    I suggest that you put the learning of regexps aside for a while and
    come back to it 'later'.

    Comment

    • Erwin Moller

      #3
      Re: regular expression

      Asper Faner wrote:
      I seem to always have hard time understaing how this regular expression
      works, especially how on earth do people bring it up as part of
      computer programming language. Natural language processing seems not
      enough to explain by the way. Why no eliminate it ?
      I am sure you'll get an answer in one of zillion groups you posted this
      stupid question to...

      Regards,
      Erwin

      Comment

      • Kleine Aap

        #4
        Re: regular expression

        Asper Faner wrote:
        I seem to always have hard time understaing how this regular expression
        works, especially how on earth do people bring it up as part of
        computer programming language. Natural language processing seems not
        enough to explain by the way. Why no eliminate it ?
        I.M.H.O. anyone that is not capable to grasp the concept of regular
        expressions should not attempt to write computer programs at all! My
        suggestion to you would be to find a job that involves working with your
        hands...

        Comment

        • Kimmo Laine

          #5
          Re: regular expression

          "Kleine Aap" <een-niet-bestaande-kleineaap@xs4al l.nlwrote in message
          news:4587dc54$0 $18460$e4fe514c @dreader31.news .xs4all.nl...
          Asper Faner wrote:
          >
          >I seem to always have hard time understaing how this regular expression
          >works, especially how on earth do people bring it up as part of
          >computer programming language. Natural language processing seems not
          >enough to explain by the way. Why no eliminate it ?
          >
          I.M.H.O. anyone that is not capable to grasp the concept of regular
          expressions should not attempt to write computer programs at all! My
          suggestion to you would be to find a job that involves working with your
          hands...

          I disagree. I did fine for a few years without having a clue of what the
          heck regular exps are and why they are quite useful. At some point I noticed
          that I keep running into similar problems that all seem to have a trivial
          solution with regular expressions and a complex solution using sticks, glue
          and some magic. Naturally the sticks and glue were my primary choice cos I
          didn't know regexp's s well... Finally I gave up and started fiddling with
          reg exps, just a little at first, then some more and some more. Now I can
          say that I have some basic comprehension of regexps and I use them every now
          and then when needed. When you keep hitting your head to a brick wall long
          time enough, you'll eventually learn to go around it or become a graphic
          designer.

          The basic problem was that RegExp's were never mentioned when I was back in
          school learning all this programming shit so I had no basic understanding of
          it when I started writing php 9 to 5. But I eventually got it.

          --
          "Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
          http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
          spam@outolempi. net | rot13(xvzzb@bhg byrzcv.arg)


          Comment

          • Curtis

            #6
            Re: regular expression

            "Kimmo Laine" <s...@outolempi .netwrote:
            When you keep hitting your head to a brick wall long
            time enough, you'll eventually learn to go around it or become a graphic
            designer.
            LOL
            The basic problem was that RegExp's were never mentioned when I was back in
            school learning all this programming shit so I had no basic understanding of
            it when I started writing php 9 to 5. But I eventually got it.
            I was in a similar situation. When I started programming, I was
            bouncing back and forth between Perl and PHP, all the while trying to
            grasp regex in between. It was very difficult for me to wrap my mind
            around it at first, so I generally tried to stay away. But I was in a
            sort of love-hate relationship, as I found the incessant challenge
            somewhat alluring. Before I knew it, I realized I was able to
            incorporate regex into a great deal of my programming, and it
            ironically has become one of my strongest areas. Strange, I always
            found that all the regex tutorials I read always started out very easy,
            and out of nowhere became insanely hard to follow. Learning by doing
            was definitely the way I learned how to use them practically.

            To the OP, if you are struggling with regex, I would recommend making
            use of the /x modifier so that you can separate your patterns with
            whitespace.


            Curtis

            Comment

            • Erwin Moller

              #7
              Re: regular expression

              Curtis wrote:
              "Kimmo Laine" <s...@outolempi .netwrote:
              >When you keep hitting your head to a brick wall long
              >time enough, you'll eventually learn to go around it or become a graphic
              >designer.
              >
              LOL
              >
              >The basic problem was that RegExp's were never mentioned when I was back
              >in school learning all this programming shit so I had no basic
              >understandin g of it when I started writing php 9 to 5. But I eventually
              >got it.
              >
              I was in a similar situation. When I started programming, I was
              bouncing back and forth between Perl and PHP, all the while trying to
              grasp regex in between. It was very difficult for me to wrap my mind
              around it at first, so I generally tried to stay away. But I was in a
              sort of love-hate relationship, as I found the incessant challenge
              somewhat alluring. Before I knew it, I realized I was able to
              incorporate regex into a great deal of my programming, and it
              ironically has become one of my strongest areas. Strange, I always
              found that all the regex tutorials I read always started out very easy,
              and out of nowhere became insanely hard to follow. Learning by doing
              was definitely the way I learned how to use them practically.
              >
              To the OP, if you are struggling with regex, I would recommend making
              use of the /x modifier so that you can separate your patterns with
              whitespace.
              Same here. :-)
              I would like to put some attention to a great resource: 'Mastering Regular
              Expressions' by Friedl, published by O'Reilly (again).

              That Friedl-guy is aware of the fact you need practicing, and encourages you
              through the whole book with excercises to actually do it.
              All excercises are doable once your read the chapter they belong to.

              I love learn-by-doing approach for difficult stuff.
              For anybody who is thinking about learning regex, this book is totally worth
              your money.

              Erwin
              >
              >
              Curtis

              Comment

              • Roman

                #8
                Re: regular expression

                Asper Faner wrote:
                I seem to always have hard time understaing how this regular expression
                works, especially how on earth do people bring it up as part of
                computer programming language. Natural language processing seems not
                enough to explain by the way. Why no eliminate it ?
                >
                It has very much to do with computer programming. There is program flow,
                conditions, loops, variables.

                Roman

                Comment

                • aejw.com

                  #9
                  Re: regular expression

                  Also regular expressions are (pretty much) universal accross a ton of
                  languages... even search engines now provide some support for regular
                  expressions... I know its a bit of a headache, but keep trying to learn it
                  mate. Once you have it wrapped you will never look back.

                  Adam - http://www.aejw.com/?page=contact

                  "Roman" <me47@dipmicro. comwrote in message
                  news:22Gih.1809 3$Ca.6266@read2 .cgocable.net.. .
                  Asper Faner wrote:
                  >I seem to always have hard time understaing how this regular expression
                  >works, especially how on earth do people bring it up as part of
                  >computer programming language. Natural language processing seems not
                  >enough to explain by the way. Why no eliminate it ?
                  >>
                  >
                  It has very much to do with computer programming. There is program flow,
                  conditions, loops, variables.
                  >
                  Roman

                  Comment

                  • Joe Kesselman

                    #10
                    Re: regular expression

                    Reminder: anything crossposted across this many newsgroups, especially
                    asking an inherently bogus question, is probably just trolling.

                    If it's equally on topic everywhere, that means it's on topic nowhere.

                    --
                    () ASCII Ribbon Campaign | Joe Kesselman
                    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry

                    Comment

                    • Dustan

                      #11
                      Re: regular expression


                      Kleine Aap wrote:
                      Asper Faner wrote:
                      >
                      I seem to always have hard time understaing how this regular expression
                      works, especially how on earth do people bring it up as part of
                      computer programming language. Natural language processing seems not
                      enough to explain by the way. Why no eliminate it ?
                      >
                      I.M.H.O. anyone that is not capable to grasp the concept of regular
                      expressions should not attempt to write computer programs at all! My
                      suggestion to you would be to find a job that involves working with your
                      hands...
                      Your humble opinion doesn't get much ruder...

                      Perhaps you meant "anyone that is not capable to grasp the concept of
                      regular expressions after some experience with programming should not
                      attempt to write computer programs at all!" Then at least newbies would
                      have a leg to stand on.

                      Otherwise, you're practically cutting off all entrances into the world
                      of programming! The concept of regular expressions isn't exactly the
                      simplest one out there. Just because you understood it immediately
                      (which I'm guessing you did, considering your harsh response), doesn't
                      mean others find the concept that simple.

                      Comment

                      • Stef Mientki

                        #12
                        Re: regular expression

                        Dustan wrote:
                        Kleine Aap wrote:
                        >Asper Faner wrote:
                        >>
                        >>I seem to always have hard time understaing how this regular expression
                        >>works, especially how on earth do people bring it up as part of
                        >>computer programming language. Natural language processing seems not
                        >>enough to explain by the way. Why no eliminate it ?
                        >I.M.H.O. anyone that is not capable to grasp the concept of regular
                        >expressions should not attempt to write computer programs at all! My
                        >suggestion to you would be to find a job that involves working with your
                        >hands...
                        >
                        Your humble opinion doesn't get much ruder...
                        >
                        Perhaps you meant "anyone that is not capable to grasp the concept of
                        regular expressions after some experience with programming should not
                        attempt to write computer programs at all!" Then at least newbies would
                        have a leg to stand on.
                        >
                        Otherwise, you're practically cutting off all entrances into the world
                        of programming! The concept of regular expressions isn't exactly the
                        simplest one out there. Just because you understood it immediately
                        (which I'm guessing you did, considering your harsh response), doesn't
                        mean others find the concept that simple.
                        >
                        I agree, and in addition:

                        (large) regular expressions are easy to write,
                        but can be almost impossible to read back !

                        I once had a program to generate and evaluate regular expressions,
                        but can't find it anymore :-(

                        If someone has links to regex generators/evaluators,
                        I'ld be much obliged.

                        cheers.
                        Stef Mientki

                        Comment

                        • Rad [Visual C# MVP]

                          #13
                          Re: regular expression

                          On Sun, 24 Dec 2006 16:36:31 +0100, Stef Mientki wrote:
                          Dustan wrote:
                          >Kleine Aap wrote:
                          >>Asper Faner wrote:
                          >>>
                          >>>I seem to always have hard time understaing how this regular expression
                          >>>works, especially how on earth do people bring it up as part of
                          >>>computer programming language. Natural language processing seems not
                          >>>enough to explain by the way. Why no eliminate it ?
                          >>I.M.H.O. anyone that is not capable to grasp the concept of regular
                          >>expressions should not attempt to write computer programs at all! My
                          >>suggestion to you would be to find a job that involves working with your
                          >>hands...
                          >>
                          >Your humble opinion doesn't get much ruder...
                          >>
                          >Perhaps you meant "anyone that is not capable to grasp the concept of
                          >regular expressions after some experience with programming should not
                          >attempt to write computer programs at all!" Then at least newbies would
                          >have a leg to stand on.
                          >>
                          >Otherwise, you're practically cutting off all entrances into the world
                          >of programming! The concept of regular expressions isn't exactly the
                          >simplest one out there. Just because you understood it immediately
                          >(which I'm guessing you did, considering your harsh response), doesn't
                          >mean others find the concept that simple.
                          >>
                          I agree, and in addition:
                          >
                          (large) regular expressions are easy to write,
                          but can be almost impossible to read back !
                          >
                          I once had a program to generate and evaluate regular expressions,
                          but can't find it anymore :-(
                          >
                          If someone has links to regex generators/evaluators,
                          I'ld be much obliged.
                          >
                          cheers.
                          Stef Mientki
                          A good tool to write, test and analyse regexes is the Regulator, available
                          here http://sourceforge.net/projects/regulator/

                          A good reference site is http://www.regular-expressions.info/, with
                          tutorials, examples and tools
                          --
                          Bits.Bytes

                          Comment

                          • deviantbunnylord@gmail.com

                            #14
                            Re: regular expression


                            Rad [Visual C# MVP] wrote:
                            On Sun, 24 Dec 2006 16:36:31 +0100, Stef Mientki wrote:
                            >
                            Dustan wrote:
                            Kleine Aap wrote:
                            >Asper Faner wrote:
                            >>
                            >>I seem to always have hard time understaing how this regular expression
                            >>works, especially how on earth do people bring it up as part of
                            >>computer programming language. Natural language processing seems not
                            >>enough to explain by the way. Why no eliminate it ?
                            Hi folks, fairly new to the list(Python is my first programming
                            language, so I'm fairly new to the world of programming too)but this is
                            a question I've been wondering about since I started learning about the
                            re module. Are regular expressions what makes mark up languages
                            interpretable by webbrowsers?

                            Comment

                            • Dustan

                              #15
                              Re: regular expression


                              deviantbunnylor d@gmail.com wrote:
                              Rad [Visual C# MVP] wrote:
                              On Sun, 24 Dec 2006 16:36:31 +0100, Stef Mientki wrote:
                              Dustan wrote:
                              >Kleine Aap wrote:
                              >>Asper Faner wrote:
                              >>>
                              >>>I seem to always have hard time understaing how this regular expression
                              >>>works, especially how on earth do people bring it up as part of
                              >>>computer programming language. Natural language processing seems not
                              >>>enough to explain by the way. Why no eliminate it ?
                              >
                              Hi folks, fairly new to the list(Python is my first programming
                              language, so I'm fairly new to the world of programming too)but this is
                              a question I've been wondering about since I started learning about the
                              re module. Are regular expressions what makes mark up languages
                              interpretable by webbrowsers?
                              I don't actually know the answer, but my educated guess:

                              Regular expressions are just the simplest way to parse any text, but
                              there are other ways. Webbrowsers most likely depend on regular
                              expressions just because it's a relatively quick and easy way to
                              interpret the language.

                              Comment

                              Working...