Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    use of regular expressions

    i'm using regular expressions libary in c# and i want to search a text starting with aaa or bbb and ends with any numbers of a's and b's ... thnx

  • #2
    New Coder
    Join Date
    Nov 2013
    Location
    Lahore
    Posts
    30
    Thanks
    2
    Thanked 3 Times in 3 Posts
    I can tell you in simple array if you want to know this. I am here to help you.

  • Users who have thanked thefasninja for this post:

    samEE666 (12-08-2013)

  • #3
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    yes i want to learn how....

  • #4
    New Coder
    Join Date
    Nov 2013
    Location
    Lahore
    Posts
    30
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by samEE666 View Post
    yes i want to learn how....
    First of all you have to create an array then check the size of array when user enter any character or word. after adding all the words. you have to get their NULL point after getting NULL point compare first 3 element with a and after this using your last null value again compare it with a or b.

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by samEE666 View Post
    i'm using regular expressions libary in c# and i want to search a text starting with aaa or bbb and ends with any numbers of a's and b's ... thnx

    /^(aaa|bbb)[ab]*$/
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,897
    Thanks
    46
    Thanked 202 Times in 201 Posts
    No, you don't need to do an array- you can use the regex like felgall posted.. It would be pertinent to explore the regex class... Visual Studio has a lot of snap-in testers for this as well

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


  •  

    Posting Permissions

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