Jump to content

Regular Expression, all options inside?

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Stasonix

Stasonix

    Learning Programmer

  • Members
  • PipPipPip
  • 82 posts
  • Programming Language:C++, PHP, JavaScript, Delphi/Object Pascal, Pascal
  • Learning:C++, PHP, JavaScript, Delphi/Object Pascal
I need to use it in Code Gear or Delphi 7, but it's not matter a lot, I need only a regexpr patter, so I need a regular expression that choose ONLY A WORD SYMBOLS, for example I have strings like this:

@first
22Second
+Third
_!293-four
{SPACE}five
4_ 42~1!Six

And I need to return only a word, not a symbols or numbers on start of the string, like (;3,-+!?..@0-9).

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
[a-zA-Z]*
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
lespauled

lespauled

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 231 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash
I believe that will also give null values when they are not found. But simply change the asterisk to a plus sign and it should work: [a-zA-Z]+




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users