LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2015, 12:00 AM   #1
niteen
Member
 
Registered: Mar 2013
Location: India
Distribution: Fedora
Posts: 66

Rep: Reputation: Disabled
required help on regular expression


Hi all,

i gotta match below mentioned string

76;0;0;0;0;0;0;0;000000AAAA:0:AA00;1;9;1;_TVT-release19;

i wrote likewise

Code:
(\d+){10}(;\s*\w+)*
i am in need of best possible match.
help me in finding that.

--
thanks in advance
 
Old 05-08-2015, 12:32 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Code:
'[[:digit:]]+;(0;)+0+A+:0:A+0+;1;9;1;_TVT-release19;'
 
Old 05-08-2015, 12:44 AM   #3
niteen
Member
 
Registered: Mar 2013
Location: India
Distribution: Fedora
Posts: 66

Original Poster
Rep: Reputation: Disabled
can't i start

1. matching semicolon seperated value
2. starts with digit
3. semicolon seperated values till 10-times
4. can have 2 colons

cause other values may change.

Advice plz
 
Old 05-08-2015, 12:51 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
http://www.myezapp.com/apps/dev/regexp/show.ws

You need to construct regexp from your specification. For example:
1. that looks not really usable
2. ^\d
3. (;[^;]){10}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Need help with regular expression, /[a-z][\.\?!]\s+[A-Z]/ blueskynet Linux - Newbie 9 04-29-2012 01:41 PM
Need help with a regular expression abefroman Programming 2 05-28-2008 09:17 PM
regular expression [tT]h* sycamorex Programming 3 01-15-2008 04:43 PM
Do we have regular expression in C++ ? indian Programming 4 03-06-2006 09:54 AM
Need help with Regular Expression subaruwrx Linux - Newbie 6 09-04-2004 07:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration