Hi Just want to find out if regular expression is possible.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vinay Bhushan

    Hi Just want to find out if regular expression is possible.

    Hello Strange problem with regex parsing.

    The regular expession search text

    217.173.102.220 - foomart [08/Feb/2008:15:36:26 +0000]

    regular expression.

    (.*[^\s]\s)(-)(\s)(.*[^\s])

    i can read the following as

    (Give me any thing except the space charecter followed by a space)
    217.173.102.220
    (Give me - char) -
    (Give me space charecter) a whitespace
    (Give me any thing except space charecter) expected foomart : ouptput
    is foomart [08/Feb/2008:15:36:26 +0000]

    can you please let me know how to do this i can write a \w but foomart
    can be foo.mart or foo_mart or foo&mart hence i dont want to use a \w
    in this case

    i just want some thing similar which is ( Give me any thing till the
    space)

    Regards
    Vinay

  • Vinay Bhushan

    #2
    Re: Hi Just want to find out if regular expression is possible.

    found out how to do it ([^/\s]*\s*)

    read the following as

    simply say (not of space) any number of repeats followed by space
    charecter repeats,

    Regards
    Vinay

    On 29 Apr, 17:25, Vinay Bhushan <bhushanvi...@g mail.comwrote:
    Hello Strange problem with regex parsing.
    >
    The regular expession search text
    >
    217.173.102.220 - foomart [08/Feb/2008:15:36:26 +0000]
    >
    regular expression.
    >
    (.*[^\s]\s)(-)(\s)(.*[^\s])
    >
    i can read the following as
    >
    (Give me any thing except the space charecter followed by a space)
    217.173.102.220
    (Give me - char) -
    (Give me space charecter) a whitespace
    (Give me any thing except space charecter) expected foomart : ouptput
    is foomart [08/Feb/2008:15:36:26 +0000]
    >
    can you please let me know how to do this i can write a \w but foomart
    can be foo.mart or foo_mart or foo&mart hence i dont want to use a \w
    in this case
    >
    i just want some thing similar which is ( Give me any thing till the
    space)
    >
    Regards
    Vinay

    Comment

    Working...