[erlang-questions] How to detect \. in Markdown string

lloyd@REDACTED lloyd@REDACTED
Wed Jun 21 07:03:09 CEST 2017


Hello,
 
Daring Fireballs Markdown specification notes :
"1986. What a great season.
In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period:
1986\. What a great season."

https://daringfireball.net/projects/markdown/syntax#block

But darned if I can find an Erlang function to distinguish these two cases:

2> S = "1986\. What a great season.".
"1986. What a great season."
3> 
3> string:chr(S, "\.").
** exception error: no function clause matching string:chr("1986. What a great season.",".") (string.erl, line 97)
4> string:chr(S, "$\.").
** exception error: no function clause matching string:chr("1986. What a great season.","$.") (string.erl, line 97)
Yada yada

Indeed it looks like the escape character isn't even represented in the string.

Can anyone please show me the way?

Best wishes,

LRP


 
 
 
*********************************************
My books:

THE GOSPEL OF ASHES
http://thegospelofashes.com

Strength is not enough. Do they have the courage 
and the cunning? Can they survive long enough to 
save the lives of millions? 

FREEIN' PANCHO
http://freeinpancho.com

A community of misfits help a troubled boy find his way 

AYA TAKEO
http://ayatakeo.com

Star-crossed love, war and power in an alternative 
universe

Available through Amazon or by request from your 
favorite bookstore


**********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170621/22bcb125/attachment.htm>


More information about the erlang-questions mailing list