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 2 of 2
  1. #1
    New Coder
    Join Date
    May 2009
    Location
    INDIA
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Regex-get integer between tags

    Hi,
    Please excuse if similar issue has been posted earlier.
    My data is like

    I am going [ABCDEF]123[/ABCDEF] to movie.
    I want a regex to get the value between [ABCDEF] and [/ABCDEF] only if its integer.
    eg if its [ABCDEF]junk characters[/ABCDEF] then I dont want...but if its [ABCDEF]123[/ABCDEF]
    then I require 123

    Regards

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Code:
    /\[ABCDEF\](\d+)\[\/ABCDEF\]/


  •  

    Posting Permissions

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