Regular expression to extract information

Hello,

I'm looking for a formula to extract all spaces (blanks) from a text, and for that, I need to use regular expressions like [a-z A-Z]* [F f]red[a-z] which means any string containing the word Fred

Can someone help me???? I'm lost!
Thank youuuu
Configuration: Windows XP Firefox 3.5.7

4 answers

  1. Moderator
    Hi,

    what do you mean by 'extracting'?

    --

    A+ Blux
     "The idiots, they dare to do anything. That's how we recognize them." 
    1. Do you want to count how many words are in the text?
      In which language?
      1. Extracting means spotting in a text all occurrences of my choice. In this case, therefore, the white spaces.
        There is no specific language; we call this information extraction using regular expressions or patterns.
        1. Moderator
          I know how regular expressions work, but I still don't understand the meaning of your question: do you want to count them?

          A regular expression can be used to delete characters, replace them, find them, or even assign them to variables for use in the same expression...

          --

          A+ Blux
           "Fools dare anything. It's even how we recognize them." 
        2. @bluxYes and no, I don't really need to know the number of spaces in my text, I just need to find the formula that highlights them in TextPad for example. I was thinking of this formula [^ ]+.
        3. Moderator
          @anjie451[^ ]+
          This is something that starts with several spaces...

          In textpad, you search, and in the dialog box, you check regular expression and you can put either a space or a space in brackets (for readability).

          Note that the [] are there to indicate a choice range.

          --

          See you Blux           
           "The idiots, they dare everything. It's even how we recognize them"
        4. @bluxSo to identify blanks in a text, would it be [ ] or not?
          sorry, I'm just starting out...
        5. Moderator
          @anjie451A blank is enough, it's just another character...

          --

          A+ Blux
           "Fools dare everything. It's even how we recognize them" 
      2. You need a LEX or FLEX on Linux to compose regular expressions and call a C method to count occurrences.