473,387 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Parsing longer strings

Hello friends,
I want to parse a string which has many tokens. Some tokens may be
present or absent.
eg.
A --B,C,D,E ;

B --b,M,N | null ;

C --O,c, (P|Q) ;

....
...
..
E --T, CR-LF, space;
....
....
....

end

such type of grammar, I want to parse and to read necessory tokens.
But no production rule is recursive or mutual recursive.
Is it worth to use Regex or Regex with named capturing?
If it is enough, then can someone point to some good tutorial for
regex with *named capturing* ?

Yours
Advait
Dec 9 '07 #1
2 1192
Hello friends,
In the above post, by the word 'longer stirings', I meant to say
size < 1k

yours
Advait
Dec 9 '07 #2


"Advait Mohan Raut" wrote:
Hello friends,
I want to parse a string which has many tokens. Some tokens may be
present or absent.
eg.
A --B,C,D,E ;

B --b,M,N | null ;

C --O,c, (P|Q) ;

....
...
..
E --T, CR-LF, space;
....
....
....

end

such type of grammar, I want to parse and to read necessory tokens.
But no production rule is recursive or mutual recursive.
Is it worth to use Regex or Regex with named capturing?
If it is enough, then can someone point to some good tutorial for
regex with *named capturing* ?

Yours
Advait
I'm not sure I understand why standard string.Split() would not work. You
just need to be aware you will have null items where there are consecutive
tokens, such as in item C between the comma and open parenthesis. I may be
misunderstanding your context however, and (P|Q) is in your mind one value.

Dec 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
3
by: Fuzzyman | last post by:
I want to parse some text and generate an output that is similar but not identical to the input. The string I produce will be of similar length to the input string - but a bit longer. I'm...
9
by: gov | last post by:
Hi, I've just started to learn programming and was told this was a good place to ask questions :) Where I work, we receive large quantities of data which is currently all printed on large,...
7
by: Lucas Tam | last post by:
Hi all, Does anyone know of a GOOD example on parsing text with text qualifiers? I am hoping to parse text with variable length delimiters/qualifiers. Also, qualified text could run onto...
30
by: drhowarddrfine | last post by:
I'm working with a server that will provide me the pathname to a file, among many paths. So from getenv I may get /home/myweb/page1 but, of course, there will be many variations of that. I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.