How to match n number of newline character(\n) in lex and yacc


 
Thread Tools Search this Thread
Top Forums Programming How to match n number of newline character(\n) in lex and yacc
# 8  
Old 11-14-2008
I see now that your original string is correct. But you don't need the first *. The * after the parenthesis takes care of it. The reason it works is because of |. It means either the first character range or the second character range. Really, it's redundant: you should be able to put everything into one set of brackets.
# 9  
Old 11-14-2008
MySQL

Thanks for your timely help. It was of great help to me.

Keep up the good job
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies

2. Shell Programming and Scripting

Remove last newline character..

Hi all.. I have a text file which looks like below: abcd efgh ijkl (blank space) I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file. I have tried options like... (14 Replies)
Discussion started by: Sathya83aa
14 Replies

3. UNIX for Dummies Questions & Answers

Print a newline after first match in line

Hi everyone I have a file where CP occurs both within each line and at the very end: dwer 17 knsdask= * CP hwla 17 h'wopie un CP I would like to separate the line on the first CP to get: dwer 17 knsdask= * CP hwla 17 h'wopie un CP What I have so far is: awk '{for (x=1; x<NF; x++) ... (5 Replies)
Discussion started by: meet77
5 Replies

4. UNIX for Dummies Questions & Answers

Match EOF on newline in a file

Hi, i have a file where the end-of-file might be at the end of of a valid text line or on a new line case a) p q r s t u <eof> case b) p q r s t u <eof> case c) p q r s t u <no data, only carriage return> <eof> I have a requirement where <eof> line should not be read if it's... (3 Replies)
Discussion started by: ysrini
3 Replies

5. UNIX for Dummies Questions & Answers

newline character in a variable

variable="unix\nlinux" echo $variable expected output: unix linux :wall: can i do that ?? thanks in advance!! (3 Replies)
Discussion started by: sathish92
3 Replies

6. UNIX for Dummies Questions & Answers

Match newline character "\n" in lex

Hi everyone! This is my very first post, sorry if I'm not posting in the right category. I'm trying to match a newline "/n" using lex/yacc. For example, print(9,'\n',8) should print 9 8 now do I write a regular expression to match exactly " '\n' " Thanks! (1 Reply)
Discussion started by: code21
1 Replies

7. Programming

actions before parsing rules in lex n yacc

Hi , We have developed a grammer for our domain language using lex n yacc. I want to know is there any pre defined lex-yacc function which gets call before executing any rule (or rules). Oue requirement is, before processing any rule ,we want to perform some specific actions ? is there... (0 Replies)
Discussion started by: supritjain
0 Replies

8. UNIX for Dummies Questions & Answers

echo without newline character

hi, I have a for loop where in I write some file name to another file. I want to write all the filenames to another without any newlines. how can i avoid getting new lines with echo? Thanks, Srilaxmi (2 Replies)
Discussion started by: srilaxmi
2 Replies

9. UNIX for Dummies Questions & Answers

newline character

hi, I want to print the below lines "Message from bac logistics The Confirmation File has not been received." When i give like this in the code "Message from bac logistics\n The Confirmation File has not been received." It is giving only Message from bac logistics\n The... (9 Replies)
Discussion started by: trichyselva
9 Replies

10. Linux

lex for Chinese character

Hi, I need to read one chinese char using lex. I tried using "." ( period ) for pattern matching but in vain. Could anyone suggest me how do i proceeed. Sample pgm: to read a chinese char in single quotes. %{ #include <locale.h> %} %% \'.\' printf("SUCCESS\n"); . ... (0 Replies)
Discussion started by: suman_jakkula
0 Replies
Login or Register to Ask a Question