| View previous topic :: View next topic |
| Author |
Message |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Fri Nov 18, 2016 3:06 pm Post subject: How to read text in front of exact character |
|
|
For example i have line
text1 text2 [something] text3 text4 [else] text5
How can i read "text1 text2" _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri Nov 18, 2016 4:06 pm Post subject: Re: How to read text in front of exact character |
|
|
| Madalin wrote: | For example i have line
text1 text2 [something] text3 text4 [else] text5
How can i read "text1 text2" |
In the above, you seem to be asking how to get the first two words.
Yet in the topic:
"How to read text in front of exact character"
So:
Can you give a better example? Is "[something]" relevant, or not? _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Fri Nov 18, 2016 4:12 pm Post subject: |
|
|
Found it .. thanks was looking for something like
| Code: | | regexp {(.*)\]} $line "" first |
there is more work to do after but works. _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
|