Results 1 to 6 of 6

Thread: RegEx Sytax

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    RegEx Sytax

    Hey im trying to create a Regex expression to match text.
    I want to match
    Code:
      {unknow text here}
    and
    Code:
       (*unknow text here*)
    If anyone can point me in the right direction, i know about expressions from PHP but it doesnt seem to work.

    Thanks
    Last edited by john tindell; Feb 21st, 2005 at 06:12 PM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: RegEx Sytax

    \{(.)*\}

    and

    \{(\*){1}(.)*(\*){1}\}

  3. #3

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: RegEx Sytax

    Cheers, is there a way to make it work for multilines? Adding the RegexOptions.Multiline flag didnt seem to have an effect.

    Thanks

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: RegEx Sytax

    Not sure about this one.

    Try one of these:

    Code:
    ^\{(.)*\}$
    
    and
    
    ^\{(\*){1}(.)*(\*){1}\}$
    
    OR
    
    \A\{(.)*\}\Z
    
    and
    
    \A\{(\*){1}(.)*(\*){1}\}\Z

  5. #5

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: RegEx Sytax

    I found
    Code:
     [(*]\S*([^"">]+?)\S*[*)]\S*[)]
     
     [{]\S*([^"">]+?)\S*[}]|{.*?}
    which seem to work for multi line, but not single line.

    Cheers

  6. #6
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: RegEx Sytax

    I think what you're looking for is something along these lines:


    (.)(.)
    | |
    ( )
    ""
    [|||]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width