I have a string that I need to parse using regex. This string is:
http://carto1.wallonie.be/documents/terrils/fiche_terril.idc?TERRIL_id=1 Crachet 7/12
What I try to do is to separate the url and the comment, so I tried:
(\S+)\s(.+) but as result, I get:
$1 = > http://carto1.wallonie.be/documents/terrils/fiche_terril.idc?TERRIL_id=1 Crachet
$2 = > 7/12
So, it seem that first character is not a space!
I tried to replace \s by 'X' and got
http://carto1.wallonie.be/documents/terrils/fiche_terril.idc?TERRIL_id=1 CrachetX7/12
I am sure to have something strange.
I tried to replace every character by 'X' (\n, \t, etc.) but cannot find what is this "space lookalike"
How can I identify this character and split my string?
EDIT:
If you want to play with my code, this is a Yahoo! Pipe: htt开发者_StackOverflow中文版p://pipes.yahoo.com/pipes/pipe.edit?_id=a732be6cf2b7cb92cec5f9ee6ebca756
According to the Pipes documentation, it looks like it uses fairly standard regex syntax.
Some tests:
and
Try the regex
^(\S+)\s+(.*)$
with the g
and m
modifier checkboxes checked.
精彩评论