[Solved] how can i split the string with the cammas that are not embeded in braces , brackets and qutations from a string with php [closed]

One way would be to use lookarounds: <?php $data = <<<DATA func(‘name’,’family,address’) , “lorem ipsom, is a…” , [‘name’,’part’] DATA; $regex = ‘~(?<=\ ),(?=\h)~’; $parts = preg_split($regex, $data); print_r($parts); ?> See a working demo on ideone.com. Even better yet would be a (*SKIP)(*FAIL) mechanism: <?php $data = <<<DATA func(‘name’,’family,address’) , “lorem ipsom, is a…” , … Read more

[Solved] extract contact information from html with python

I use this code to extract information # _*_ coding:utf-8 _*_ import urllib2 import urllib import re from bs4 import BeautifulSoup import sys reload(sys) sys.setdefaultencoding(‘utf-8′) def grabHref(url,localfile): html = urllib2.urlopen(url).read() html = unicode(html,’gb2312′,’ignore’).encode(‘utf-8′,’ignore’) soup = BeautifulSoup(html) myfile = open(localfile,’wb’) for link in soup.select(“div > a[href^=http://www.karmaloop.com/kazbah/browse]”): for item in BeautifulSoup(urllib2.urlopen(link[‘href’]).read()).select(“div > a[href^=mailto]”): contactInfo = item.get_text() print … Read more

[Solved] Extract a part from URL in Javascript [duplicate]

try with this var url=”http://a.long.url/can/be/here/jquery.min.js?207″; var path = url.split( “https://stackoverflow.com/” ); var stripped = “”; for ( i = 0; i < path.length-1; i++ ) { if(i>0) stripped += “https://stackoverflow.com/”; stripped += path[i]; } alert(stripped) solved Extract a part from URL in Javascript [duplicate]

[Solved] Extract Last Bracketed Characters from String in Excel VBA

Try this UDF Function ExtractByRegex(sTxt As String) With CreateObject(“VBScript.RegExp”) .Pattern = “V\d+(.)?(\d+)?” If .Test(sTxt) Then ExtractByRegex = .Execute(sTxt)(0).Value End With End Function Update Here’s another version in which you can format the output Sub Test_ExtractByRegex_UDF() MsgBox ExtractByRegex(“A9 V2.3 8.99”) End Sub Function ExtractByRegex(sTxt As String) With CreateObject(“VBScript.RegExp”) .Pattern = “V\d+(.)?(\d+)?” If .Test(sTxt) Then sTxt = … Read more

[Solved] Live statistics chess960 from chess.com?

Copy of my answer on Chess.SE, in case someone is looking here for an answer. Yes, it’s possible to obtain the data you want. Chess.com has a REST API which is described in the following news post: https://www.chess.com/news/view/published-data-api You can use the following URL to get a list of monthly archives of a players games: … Read more

[Solved] How to remove part of a data string? [closed]

It’s unclear what ResultSet is and its format from your question, however the following example code might be helpful: import csv csv_filename=”result_set.csv” ResultSet = {“(u’maxbotix_depth’, None)”: [{u’time’: u’2017-07-12T12:15:54.107488923Z’, u’value’: 7681}, {u’time’: u’2017-07-12T12:26:01.295268409Z’, u’value’: 7672}]} with open(csv_filename, mode=”wb”) as csv_file: writer = csv.writer(csv_file) for obj in ResultSet[“(u’maxbotix_depth’, None)”]: time, value = obj[u’time’], obj[u’value’] print(‘time: {}, value: … Read more

[Solved] python url extract from html

Observe Python 2.7.3 (default, Sep 4 2012, 20:19:03) [GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9 Type “help”, “copyright”, “credits” or “license” for more information. >>> junk=”’ <a href=””http://a0c5e.site.it/r”” target=_blank><font color=#808080>MailUp</font></a> … <a href=””http://www.site.it/prodottiLLPP.php?id=1″” class=””txtBlueGeorgia16″”>Prodotti</a> … <a href=””http://www.site.it/terremoto.php”” target=””blank”” class=””txtGrigioScuroGeorgia12″”>Terremoto</a> … <a class=”mini” href=”http://www.site.com/remove/professionisti.aspx?Id=65&Code=xhmyskwzse”>clicca qui.</a>`”’ >>> import re >>> pat=re.compile(r”’http[\:/a-zA-Z0-9\.\?\=&]*”’) >>> pat.findall(junk) [‘http://a0c5e.site.it/r’, ‘http://www.site.it/prodottiLLPP.php?id=1’, ‘http://www.site.it/terremoto.php’, ‘http://www.site.com/remove/professionisti.aspx?Id=65&Code=xhmyskwzse’] … Read more