解析PostgreSQL中的子字符串

时间:2017-11-28 17:04:45

标签: regex postgresql

给出一个字符串,例如:

RT @John: Hello world! @Peter Hello!

我希望能够在RT @'之间获得分数。和':'。我怎样才能在PostgreSQL中实现这个目标?

1 个答案:

答案 0 :(得分:0)

也许一个简单的SUBSTRING可以解决您的问题:

import javax.swing.JFrame;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JLabel;
import javax.swing.Icon;
import javax.swing.ImageIcon;

public class ExecuteMe extends JFrame {

    private static final long serialVersionUID = 1L;

    public static void main(String[] args) throws MalformedURLException {

        URL url = new URL("http://gph.is/291u1MC");
        Icon icon = new ImageIcon(url);
        JLabel label = new JLabel(icon);

        JFrame f = new JFrame("Animation");
        f.getContentPane().add(label);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    }

}