CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    4

    Regular Expression

    Maybe someone can help me with regular expressions. I have read the articles posted
    here at codeguru, but I still can't understand them.

    Can someone please translate the following search strings in regex:
    world && USA
    world || USA
    world && !USA

    I think with these examples I might understand regular expressions (hopefully).

    Thanx in advance

    BARNIE



  2. #2
    Join Date
    May 1999
    Posts
    667

    Re: Regular Expression

    I assumed you want a regular expression to match any of the three examples provided.

    world[ \t]+[(&&)|(\|\|))[ \t]+!*USA

    world (find world)
    [ \t]+ (find one or more spaces and or tabs)
    [(&&)|(\|\|)] find && or ||
    [ \t]+ (find one or more spaces and or tabs)
    !* (find 0 or more !) (some regex support ? which means 0 or 1 of previous expression VC 5 does not)
    USA (find USA)

    HTH,
    Chris



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

Featured