开发者

In my string, there is a character that I cannot identify that seems to be a space (Regex)

开发者 https://www.devze.com 2023-04-09 15:20 出处:网络
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

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:

In my string, there is a character that I cannot identify that seems to be a space (Regex)

and

In my string, there is a character that I cannot identify that seems to be a space (Regex)


Try the regex

^(\S+)\s+(.*)$

with the g and m modifier checkboxes checked.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号