Hi there
it is not C syntax but regexp syntax, ^ means (at the beginning of the string) and parenteses with | inside means, "one of the following", so the first example will found
Contact: whatever@192.168. Contact: whatever@10. Contact: whatever@172.16. m: whatever@192.168. m: whatever@10. m: whatever@172.16.
but WILL NOT found
anythingContact: ... anythingm: ...
the second example will found both
From... anythingFrom...
you problably get the picture now
hope this helps !3runo
Che Sosa wrote:
Hello list, I am not so familiar with C syntax but I suspect that the circumflex changes the parsing method. What is the difference between these two:
first-> search("^(Contact|m): .*@(192.168.|10.|172.16)") second-> search("(From|f):.*@foo.bar")
Questions:
- How does the circumflex affect the string inside ( )
- How is ( ) used?
Thanks, Che